uboot-sunxi: add uboot-sunxi-all for selecting all other variants
[openwrt/staging/florian.git] / package / boot / uboot-sunxi / Makefile
1 #
2 # Copyright (C) 2013-2016 OpenWrt.org
3 # Copyright (C) 2017 Yousong Zhou
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=u-boot
13 PKG_VERSION:=2016.03
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
16 PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb
17 PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
18 PKG_LICENSE:=GPL-2.0 GPL-2.0+
19 PKG_LICENSE_FILES:=Licenses/README
20
21 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/uboot/template
26 define Package/uboot-sunxi-$(1)
27 SECTION:=boot
28 CATEGORY:=Boot Loaders
29 DEPENDS:=@TARGET_sunxi
30 TITLE:=U-Boot for $(2)
31 URL:=http://www.denx.de/wiki/U-Boot
32 VARIANT:=$(1)
33 endef
34
35 define Package/uboot-sunxi-$(1)/install
36 $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
37 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin
38 mkimage -C none -A arm -T script -d uEnv-$(if $(3),$(3),default).txt \
39 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr
40 endef
41
42 UBOOT_SUNXI_PACKAGES += uboot-sunxi-$(1)
43
44 endef
45
46 $(eval $(call Package/uboot/template,A10-OLinuXino-Lime,the A10 OLinuXino LIME))
47 $(eval $(call Package/uboot/template,A13-OLinuXino,the A13 OlinuXino))
48 $(eval $(call Package/uboot/template,A20-OLinuXino-Lime,the A20 OLinuXino LIME))
49 $(eval $(call Package/uboot/template,A20-OLinuXino_MICRO,A20 OLinuXino MICRO))
50 $(eval $(call Package/uboot/template,Bananapi,Bananapi))
51 $(eval $(call Package/uboot/template,Bananapro,Bananapro))
52 $(eval $(call Package/uboot/template,Cubieboard,Cubieboard))
53 $(eval $(call Package/uboot/template,Cubieboard2,Cubieboard2))
54 $(eval $(call Package/uboot/template,Cubietruck,Cubietruck))
55 $(eval $(call Package/uboot/template,Hummingbird_A31,the Hummingbird A31 board))
56 $(eval $(call Package/uboot/template,Mele_M9,the Mele M9 (A31)))
57 $(eval $(call Package/uboot/template,OLIMEX_A13_SOM,the Olimex A13 SOM))
58 $(eval $(call Package/uboot/template,Linksprite_pcDuino,Linksprite pcDuino))
59 $(eval $(call Package/uboot/template,Linksprite_pcDuino3,Linksprite pcDuino3))
60 $(eval $(call Package/uboot/template,Lamobo_R1,Lamobo R1))
61 $(eval $(call Package/uboot/template,orangepi_plus,Orange Pi Plus (H3)))
62 $(eval $(call Package/uboot/template,pangolin,Theobroma A31-yQ7 devboard,pangolin))
63
64 define Package/uboot-sunxi-all
65 SECTION:=boot
66 CATEGORY:=Boot Loaders
67 DEPENDS:=@TARGET_sunxi
68 TITLE:=Meta package for selecting all variants of uboot-sunxi
69 URL:=http://www.denx.de/wiki/U-Boot
70 DEPENDS:=$(patsubst %,+%,$(UBOOT_SUNXI_PACKAGES))
71 endef
72
73 ifdef BUILD_VARIANT
74 define Build/Configure
75 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
76 USE_PRIVATE_LIBGCC=yes $(BUILD_VARIANT)_defconfig
77 endef
78
79 define Build/Compile
80 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
81 CROSS_COMPILE=$(TARGET_CROSS) \
82 DTCDIR=$(LINUX_DIR)/scripts/dtc/
83 endef
84 else # BUILD_VARIANT
85 define Build/Prepare
86 endef
87 define Build/Configure
88 endef
89 define Build/Compile
90 endef
91 endif # BUILD_VARIANT
92
93 $(foreach pkg,$(UBOOT_SUNXI_PACKAGES), \
94 $(eval $(call BuildPackage,$(pkg))) \
95 )
96 $(eval $(call BuildPackage,uboot-sunxi-all))