uboot-sunxi: bump to 2014.04
[openwrt.git] / package / boot / uboot-sunxi / Makefile
1 #
2 # Copyright (C) 2013 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:=2014.04
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 PKG_SOURCE_VERSION:=6d2116d1385a66e9a59742caa9d62a54
17 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define uboot/Default
22   TITLE:=
23   CONFIG:=
24   IMAGE:=
25 endef
26
27 define uboot/A10-OLinuXino-Lime
28   TITLE:=U-Boot 2014.04 for the A10 OLinuXino LIME
29 endef
30
31 define uboot/A13-OLinuXino
32   TITLE:=U-Boot 2014.04 for the A13 OlinuXino
33 endef
34
35 define uboot/A20-OLinuXino_MICRO
36   TITLE:=U-Boot 2014.04 for A20 OLinuXino MICRO
37 endef
38
39 define uboot/Bananapi
40   TITLE:=U-Boot 2014.04 for Bananapi
41 endef
42
43 define uboot/Cubieboard
44   TITLE:=U-Boot 2014.04 for Cubieboard
45 endef
46
47 define uboot/Cubieboard2
48   TITLE:=U-Boot 2014.04 for Cubieboard2
49 endef
50
51 define uboot/Cubietruck
52   TITLE:=U-Boot 2014.04 for Cubietruck
53 endef
54
55 define uboot/Hackberry
56   TITLE:=U-Boot 2014.04 for the Hackbeery
57 endef
58
59 define uboot/pcDuino
60   TITLE:=U-Boot 2014.04 for pcDuino
61 endef  
62
63 define uboot/Linksprite_pcDuino3
64   TITLE:=U-Boot 2014.04 for Linksprite pcDuino3
65 endef  
66
67 UBOOTS:=A10-OLinuXino-Lime A13-OLinuXino A20-OLinuXino_MICRO Bananapi Cubieboard Cubieboard2 Cubietruck Hackberry pcDuino Linksprite_pcDuino3
68
69 define Package/uboot/template
70 define Package/uboot-sunxi-$(1)
71   SECTION:=boot
72   CATEGORY:=Boot Loaders
73   DEPENDS:=@TARGET_sunxi
74   TITLE:=$(2)
75   URL:=http://www.denx.de/wiki/U-Boot
76   VARIANT:=$(1)
77   MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
78 endef
79 endef
80
81 define BuildUBootPackage
82         $(eval $(uboot/Default))
83         $(eval $(uboot/$(1)))
84         $(call Package/uboot/template,$(1),$(TITLE))
85 endef
86
87 ifdef BUILD_VARIANT
88 $(eval $(call uboot/$(BUILD_VARIANT)))
89 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
90 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
91 endif
92
93 define Build/Configure
94         $(MAKE) -C $(PKG_BUILD_DIR) \
95                 USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_config
96 endef
97
98 define Build/Compile
99         $(MAKE) -C $(PKG_BUILD_DIR) \
100                 CROSS_COMPILE=$(TARGET_CROSS)
101 endef
102
103 define Package/uboot/install/default
104         $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
105         $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
106                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
107         $(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
108                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin
109         $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
110                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin
111         $(CP) uEnv.txt \
112                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt
113 endef
114
115 define Package/uboot/install/template
116 define Package/uboot-sunxi-$(1)/install
117         $(call Package/uboot/install/default,$(2))
118 endef
119 endef
120
121 $(foreach u,$(UBOOTS), \
122         $(eval $(call Package/uboot/install/template,$(u),$(u))) \
123 )
124
125 $(foreach u,$(UBOOTS), \
126         $(eval $(call BuildUBootPackage,$(u))) \
127         $(eval $(call BuildPackage,uboot-sunxi-$(u))) \
128 )