89802d0f40018fc710979f308a324ff3abcce0cc
[openwrt/openwrt.git] / package / boot / uboot-xburst / Makefile
1 #
2 # Copyright (C) 2010 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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=u-boot
12 PKG_VERSION:=2012.10-rc2
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:= \
18 http://mirror2.openwrt.org/sources \
19 ftp://ftp.denx.de/pub/u-boot
20 PKG_MD5SUM:=451c07271940016cec6f5ad8a155263b
21 PKG_TARGETS:=bin
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define uboot/Default
26 TITLE:=
27 CONFIG:=
28 IMAGE:=
29 endef
30
31 define uboot/qi_lb60
32 TITLE:=U-boot for the qi_lb60 board
33 endef
34
35 UBOOTS:=qi_lb60
36
37 define Package/uboot/template
38 define Package/uboot-xburst-$(1)
39 SECTION:=boot
40 CATEGORY:=Boot Loaders
41 DEPENDS:=@TARGET_xburst
42 TITLE:=$(2)
43 URL:=http://www.denx.de/wiki/UBoot/WebHome
44 VARIANT:=$(1)
45 endef
46 endef
47
48 define BuildUbootPackage
49 $(eval $(uboot/Default))
50 $(eval $(uboot/$(1)))
51 $(call Package/uboot/template,$(1),$(TITLE))
52 endef
53
54
55 ifdef BUILD_VARIANT
56 $(eval $(call uboot/$(BUILD_VARIANT)))
57 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
58 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
59 endif
60
61 define Build/Configure
62 $(MAKE) -C $(PKG_BUILD_DIR) \
63 $(UBOOT_CONFIG)_config
64 endef
65
66 define Build/Compile
67 $(MAKE) -C $(PKG_BUILD_DIR) \
68 CROSS_COMPILE=$(TARGET_CROSS)
69 endef
70
71 define Package/uboot/install/template
72 define Package/uboot-xburst-$(1)/install
73 $(CP) $(PKG_BUILD_DIR)/u-boot-xburst.bin $(BIN_DIR)/$(2)
74 rmdir $$(1)
75 endef
76 endef
77
78 $(foreach u,$(UBOOTS), \
79 $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(u)-u-boot.bin)) \
80 )
81
82 $(foreach u,$(UBOOTS), \
83 $(eval $(call BuildUbootPackage,$(u))) \
84 $(eval $(call BuildPackage,uboot-xburst-$(u))) \
85 )