rpcd: iwinfo plugin fixes
[openwrt.git] / package / boot / uboot-mvebu / Makefile
1 #
2 # Copyright (C) 2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=u-boot
12 PKG_VERSION:=2016.03
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=\
18         http://mirror2.openwrt.org/sources \
19         ftp://ftp.denx.de/pub/u-boot
20 PKG_MD5SUM:=973c1d896be751321cc3aafa564f64b2
21
22 PKG_LICENSE:=GPL-2.0 GPL-2.0+
23 PKG_LICENSE_FILES:=Licenses/README
24
25 PKG_BUILD_PARALLEL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define uboot/Default
30   TITLE:=
31 endef
32
33 define uboot/clearfog
34   TITLE:=U-Boot for SolidRun ClearFog A1
35 endef
36
37 UBOOTS:= \
38         clearfog
39
40 define Package/uboot/template
41 define Package/uboot-mvebu-$(1)
42   SECTION:=boot
43   CATEGORY:=Boot Loaders
44   DEPENDS:=@TARGET_mvebu
45   TITLE:=$(2)
46   URL:=http://www.denx.de/wiki/U-Boot
47   VARIANT:=$(1)
48   MAINTAINER:=Luka Perkov <luka@openwrt.org>
49 endef
50 endef
51
52 define BuildUBootPackage
53         $(eval $(uboot/Default))
54         $(eval $(uboot/$(1)))
55         $(call Package/uboot/template,$(1),$(TITLE))
56 endef
57
58 define Build/Configure
59         +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
60                 $(BUILD_VARIANT)_config
61 endef
62
63 define Build/Compile
64         +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
65                 CROSS_COMPILE=$(TARGET_CROSS) \
66                 DTC_DIR=$(LINUX_DIR)/scripts/dtc/
67 endef
68
69 define Package/uboot/install/default
70         $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
71         $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \
72                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb
73         $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
74         $(CP) $(PKG_BUILD_DIR)/tools/kwboot \
75                 $(BIN_DIR)/u-boot-kwboot/
76 endef
77
78 define Package/uboot/install/template
79 define Package/uboot-mvebu-$(1)/install
80         $(call Package/uboot/install/default,$(2))
81 endef
82 endef
83
84 $(foreach u,$(UBOOTS), \
85         $(eval $(call Package/uboot/install/template,$(u),$(u))) \
86 )
87
88 $(foreach u,$(UBOOTS), \
89         $(eval $(call BuildUBootPackage,$(u))) \
90         $(eval $(call BuildPackage,uboot-mvebu-$(u))) \
91 )