packages: uboot-sunxi: remove unused Hackberry target
[openwrt/openwrt.git] / package / boot / uboot-sunxi / Makefile
1 #
2 # Copyright (C) 2013-2014 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
10 PKG_NAME:=u-boot
11 PKG_VERSION:=2015.01
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
13 PKG_SOURCE_URL:= \
14 http://mirror2.openwrt.org/sources \
15 ftp://ftp.denx.de/pub/u-boot
16
17 PKG_MD5SUM:=7f08dc9e98a71652bd6968888ed6ec95
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
20
21 PKG_LICENSE:=GPL-2.0 GPL-2.0+
22 PKG_LICENSE_FILES:=Licenses/README
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define uboot/Default
27 TITLE:=
28 CONFIG:=
29 IMAGE:=
30 endef
31
32 define uboot/A10-OLinuXino-Lime
33 TITLE:=U-Boot for the A10 OLinuXino LIME
34 endef
35
36 define uboot/A13-OLinuXino
37 TITLE:=U-Boot for the A13 OlinuXino
38 endef
39
40 define uboot/A20-OLinuXino-Lime
41 TITLE:=U-Boot for the A20 OLinuXino LIME
42 endef
43
44 define uboot/A20-OLinuXino_MICRO
45 TITLE:=U-Boot for A20 OLinuXino MICRO
46 endef
47
48 define uboot/Bananapi
49 TITLE:=U-Boot for Bananapi
50 endef
51
52 define uboot/Bananapro
53 TITLE:=U-Boot for Bananapro
54 endef
55
56 define uboot/Cubieboard
57 TITLE:=U-Boot for Cubieboard
58 endef
59
60 define uboot/Cubieboard2
61 TITLE:=U-Boot for Cubieboard2
62 endef
63
64 define uboot/Cubietruck
65 TITLE:=U-Boot for Cubietruck
66 endef
67
68 define uboot/Mele_M9
69 TITLE:=U-Boot for the Mele M9 (A31)
70 endef
71
72 define uboot/OLIMEX-A13-SOM
73 TITLE:=U-Boot for the Olimex A13 SOM
74 endef
75
76 define uboot/Linksprite_pcDuino
77 TITLE:=U-Boot for Linksprite pcDuino
78 endef
79
80 define uboot/Linksprite_pcDuino3
81 TITLE:=U-Boot for Linksprite pcDuino3
82 endef
83
84 UBOOTS:= \
85 A10-OLinuXino-Lime \
86 A13-OLinuXino \
87 A20-OLinuXino-Lime \
88 A20-OLinuXino_MICRO \
89 Bananapi \
90 Bananapro \
91 Cubieboard \
92 Cubieboard2 \
93 Cubietruck \
94 Mele_M9 \
95 OLIMEX-A13-SOM \
96 Linksprite_pcDuino \
97 Linksprite_pcDuino3 \
98
99 define Package/uboot/template
100 define Package/uboot-sunxi-$(1)
101 SECTION:=boot
102 CATEGORY:=Boot Loaders
103 DEPENDS:=@TARGET_sunxi
104 TITLE:=$(2)
105 URL:=http://www.denx.de/wiki/U-Boot
106 VARIANT:=$(1)
107 MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
108 endef
109 endef
110
111 define BuildUBootPackage
112 $(eval $(uboot/Default))
113 $(eval $(uboot/$(1)))
114 $(call Package/uboot/template,$(1),$(TITLE))
115 endef
116
117 ifdef BUILD_VARIANT
118 $(eval $(call uboot/$(BUILD_VARIANT)))
119 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
120 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
121 endif
122
123 define Build/Configure
124 $(MAKE) -C $(PKG_BUILD_DIR) \
125 USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_defconfig
126 endef
127
128 define Build/Compile
129 $(MAKE) -C $(PKG_BUILD_DIR) \
130 CROSS_COMPILE=$(TARGET_CROSS)
131 endef
132
133 define Package/uboot/install/default
134 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
135 $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
136 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
137 $(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
138 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin
139 $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
140 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin
141 $(CP) uEnv.txt \
142 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt
143 mkimage -C none -A arm -T script -d $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-boot.scr
144 endef
145
146 define Package/uboot/install/template
147 define Package/uboot-sunxi-$(1)/install
148 $(call Package/uboot/install/default,$(2))
149 endef
150 endef
151
152 $(foreach u,$(UBOOTS), \
153 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
154 )
155
156 $(foreach u,$(UBOOTS), \
157 $(eval $(call BuildUBootPackage,$(u))) \
158 $(eval $(call BuildPackage,uboot-sunxi-$(u))) \
159 )