Root/package/uboot-xburst/Makefile

Source at commit 1079647 created 11 years 5 months ago.
By Xiangfu, uboot-xburst: update to v2012.10-rc2
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
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=u-boot
12PKG_VERSION:=2012.10-rc2
13PKG_RELEASE:=1
14
15PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
16PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
18PKG_MD5SUM:=
19PKG_TARGETS:=bin
20
21include $(INCLUDE_DIR)/package.mk
22
23define uboot/Default
24  TITLE:=
25  CONFIG:=
26  IMAGE:=
27endef
28
29define uboot/qi_lb60
30  TITLE:=U-boot for the qi_lb60 board
31endef
32
33UBOOTS:=qi_lb60
34
35define Package/uboot/template
36define Package/uboot-xburst-$(1)
37  SECTION:=boot
38  CATEGORY:=Boot Loaders
39  DEPENDS:=@TARGET_xburst
40  TITLE:=$(2)
41  URL:=http://www.denx.de/wiki/UBoot/WebHome
42  VARIANT:=$(1)
43endef
44endef
45
46define BuildUbootPackage
47    $(eval $(uboot/Default))
48    $(eval $(uboot/$(1)))
49    $(call Package/uboot/template,$(1),$(TITLE))
50endef
51
52
53ifdef BUILD_VARIANT
54$(eval $(call uboot/$(BUILD_VARIANT)))
55UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
56UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_BARIANT)-u-boot.bin)
57endif
58
59define Build/Configure
60    $(MAKE) -C $(PKG_BUILD_DIR) \
61        $(UBOOT_CONFIG)_config
62endef
63
64define Build/Compile
65    $(MAKE) -C $(PKG_BUILD_DIR) \
66        CROSS_COMPILE=$(TARGET_CROSS)
67    $(MAKE) -C $(PKG_BUILD_DIR) \
68        CROSS_COMPILE=$(TARGET_CROSS) spl/u-boot-spl.bin
69    dd if=$(PKG_BUILD_DIR)/spl/u-boot-spl.bin of=$(PKG_BUILD_DIR)/u-boot-spl-tmp.bin conv=sync bs=8192 count=1
70    dd if=$(PKG_BUILD_DIR)/spl/u-boot-spl.bin of=$(PKG_BUILD_DIR)/u-boot-spl-tmp.bin conv=sync,notrunc oflag=append bs=8192 count=1
71    tr '\0' '\377' < /dev/zero | dd of=$(PKG_BUILD_DIR)/u-boot-spl-tmp.bin conv=sync,notrunc oflag=append bs=16384 count=1
72    cat $(PKG_BUILD_DIR)/u-boot-spl-tmp.bin $(PKG_BUILD_DIR)/u-boot.bin > $(PKG_BUILD_DIR)/u-boot-nand.bin
73endef
74
75define Package/uboot/install/template
76define Package/uboot-xburst-$(1)/install
77    $(CP) $(PKG_BUILD_DIR)/u-boot-nand.bin $(BIN_DIR)/$(2)
78    rmdir $$(1)
79endef
80endef
81
82$(foreach u,$(UBOOTS), \
83    $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(u)-u-boot.bin)) \
84)
85
86$(foreach u,$(UBOOTS), \
87    $(eval $(call BuildUbootPackage,$(u))) \
88    $(eval $(call BuildPackage,uboot-xburst-$(u))) \
89)
90

Archive Download this file



interactive