bc80dcfade9541eaf38345c86c0428a5cd2016a4
[openwrt/openwrt.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_PARALLEL:=1
22
23 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/uboot/template
28 define Package/uboot-sunxi-$(1)
29 SECTION:=boot
30 CATEGORY:=Boot Loaders
31 DEPENDS:=@TARGET_sunxi
32 TITLE:=U-Boot for $(2)
33 URL:=http://www.denx.de/wiki/U-Boot
34 VARIANT:=$(1)
35 endef
36
37 define Package/uboot-sunxi-$(1)/install
38 $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
39 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin
40 mkimage -C none -A arm -T script -d uEnv-$(if $(3),$(3),default).txt \
41 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr
42 endef
43
44 UBOOT_SUNXI_PACKAGES += uboot-sunxi-$(1)
45
46 endef
47
48 $(eval $(call Package/uboot/template,A10-OLinuXino-Lime,the A10 OLinuXino LIME))
49 $(eval $(call Package/uboot/template,A13-OLinuXino,the A13 OlinuXino))
50 $(eval $(call Package/uboot/template,A20-OLinuXino-Lime,the A20 OLinuXino LIME))
51 $(eval $(call Package/uboot/template,A20-OLinuXino_MICRO,A20 OLinuXino MICRO))
52 $(eval $(call Package/uboot/template,Bananapi,Bananapi))
53 $(eval $(call Package/uboot/template,Bananapro,Bananapro))
54 $(eval $(call Package/uboot/template,Cubieboard,Cubieboard))
55 $(eval $(call Package/uboot/template,Cubieboard2,Cubieboard2))
56 $(eval $(call Package/uboot/template,Cubietruck,Cubietruck))
57 $(eval $(call Package/uboot/template,Hummingbird_A31,the Hummingbird A31 board))
58 $(eval $(call Package/uboot/template,Mele_M9,the Mele M9 (A31)))
59 $(eval $(call Package/uboot/template,OLIMEX_A13_SOM,the Olimex A13 SOM))
60 $(eval $(call Package/uboot/template,Linksprite_pcDuino,Linksprite pcDuino))
61 $(eval $(call Package/uboot/template,Linksprite_pcDuino3,Linksprite pcDuino3))
62 $(eval $(call Package/uboot/template,Lamobo_R1,Lamobo R1))
63 $(eval $(call Package/uboot/template,orangepi_plus,Orange Pi Plus (H3)))
64 $(eval $(call Package/uboot/template,pangolin,Theobroma A31-yQ7 devboard,pangolin))
65
66 define Package/uboot-sunxi-all
67 SECTION:=boot
68 CATEGORY:=Boot Loaders
69 DEPENDS:=@TARGET_sunxi
70 TITLE:=Meta package for selecting all variants of uboot-sunxi
71 URL:=http://www.denx.de/wiki/U-Boot
72 DEPENDS:=$(patsubst %,+%,$(UBOOT_SUNXI_PACKAGES))
73 endef
74
75 ifdef BUILD_VARIANT
76 define Build/Configure
77 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
78 USE_PRIVATE_LIBGCC=yes $(BUILD_VARIANT)_defconfig
79 endef
80
81 define Build/Compile
82 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
83 CROSS_COMPILE=$(TARGET_CROSS) \
84 DTCDIR=$(LINUX_DIR)/scripts/dtc/
85 endef
86 else # BUILD_VARIANT
87 define Build/Prepare
88 endef
89 define Build/Configure
90 endef
91 define Build/Compile
92 endef
93 endif # BUILD_VARIANT
94
95 $(foreach pkg,$(UBOOT_SUNXI_PACKAGES), \
96 $(eval $(call BuildPackage,$(pkg))) \
97 )
98 $(eval $(call BuildPackage,uboot-sunxi-all))