[package] uboot-imx6: update to v2013.07
[openwrt.git] / package / boot / uboot-imx6 / 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:=2013.07
12 PKG_RELEASE:=1
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
17 PKG_MD5SUM:=8445162690052e6afd4b8f87af2bb557
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define uboot/Default
22   TITLE:=
23   CONFIG:=
24   IMAGE:=
25 endef
26
27 define uboot/wandboard_solo
28   TITLE:=U-Boot for the Wandboard Solo
29 endef
30
31 define uboot/wandboard_dl
32   TITLE:=U-Boot for the Wandboard Dual Lite
33 endef
34
35 define uboot/wandboard_quad
36   TITLE:=U-Boot for the Wandboard Quad
37 endef
38
39 UBOOTS := \
40         wandboard_solo \
41         wandboard_dl \
42         wandboard_quad
43
44 define Package/uboot/template
45 define Package/uboot-imx6-$(1)
46   SECTION:=boot
47   CATEGORY:=Boot Loaders
48   DEPENDS:=@TARGET_imx6
49   TITLE:=$(2)
50   URL:=http://www.denx.de/wiki/U-Boot
51   VARIANT:=$(1)
52   MAINTAINER:=Luka Perkov <luka@openwrt.org>
53 endef
54 endef
55
56 define BuildUBootPackage
57         $(eval $(uboot/Default))
58         $(eval $(uboot/$(1)))
59         $(call Package/uboot/template,$(1),$(TITLE))
60 endef
61
62 ifdef BUILD_VARIANT
63 $(eval $(call uboot/$(BUILD_VARIANT)))
64 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
65 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
66 endif
67
68 define Build/Configure
69         $(MAKE) -C $(PKG_BUILD_DIR) \
70                 $(UBOOT_CONFIG)_config
71 endef
72
73 define Build/Compile
74         $(MAKE) -C $(PKG_BUILD_DIR) \
75                 CROSS_COMPILE=$(TARGET_CROSS)
76 endef
77
78 define Package/uboot/install/default
79         $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
80         $(CP) \
81                 $(PKG_BUILD_DIR)/u-boot.imx \
82                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx
83 endef
84
85 define Package/uboot/install/template
86 define Package/uboot-imx6-$(1)/install
87         $(call Package/uboot/install/default,$(2))
88 endef
89 endef
90
91 $(foreach u,$(UBOOTS), \
92         $(eval $(call Package/uboot/install/template,$(u),$(u))) \
93 )
94
95 $(foreach u,$(UBOOTS), \
96         $(eval $(call BuildUBootPackage,$(u))) \
97         $(eval $(call BuildPackage,uboot-imx6-$(u))) \
98 )