license info - revert r43155
[openwrt.git] / package / boot / uboot-kirkwood / Makefile
1 #
2 # Copyright (C) 2010-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:=2014.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:= \
17         http://mirror2.openwrt.org/sources \
18         ftp://ftp.denx.de/pub/u-boot
19 PKG_MD5SUM:=36d4bad687edcafa396fee607e505d4e
20 PKG_TARGETS:=bin
21
22 PKG_BUILD_PARALLEL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define uboot/Default
27   TITLE:=
28   CONFIG:=
29   IMAGE:=
30 endef
31
32 define uboot/dockstar
33   TITLE:=U-Boot for Seagate DockStar
34 endef
35
36 define uboot/dockstar_second_stage
37   TITLE:=second stage U-Boot for Seagate DockStar
38 endef
39
40 define uboot/goflexhome
41   TITLE:=U-Boot for the Seagate GoFlexHome/GoFlexNet
42 endef
43
44 define uboot/ib62x0
45   TITLE:=U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220
46 endef
47
48 define uboot/ib62x0_second_stage
49   TITLE:=second stage U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220
50 endef
51
52 define uboot/iconnect
53   TITLE:=U-Boot for Iomega iConnect Wireless
54 endef
55
56 define uboot/iconnect_second_stage
57   TITLE:=second stage U-Boot for Iomega iConnect Wireless
58 endef
59
60 define uboot/pogo_e02
61   TITLE:=U-Boot for Cloud Engines Pogoplug E02
62 endef
63
64 define uboot/pogo_e02_second_stage
65   TITLE:=second stage U-Boot for Cloud Engines Pogoplug E02
66 endef
67
68 define uboot/sheevaplug
69   TITLE:=U-Boot for SheevaPlug
70 endef
71
72 UBOOTS:= \
73         dockstar dockstar_second_stage \
74         goflexhome \
75         ib62x0 ib62x0_second_stage \
76         iconnect iconnect_second_stage \
77         pogo_e02 pogo_e02_second_stage \
78         sheevaplug
79
80 define Package/uboot/template
81 define Package/uboot-kirkwood-$(1)
82   SECTION:=boot
83   CATEGORY:=Boot Loaders
84   DEPENDS:=@TARGET_kirkwood
85   TITLE:=$(2)
86   URL:=http://www.denx.de/wiki/U-Boot
87   VARIANT:=$(1)
88 endef
89 endef
90
91 define BuildUBootPackage
92         $(eval $(uboot/Default))
93         $(eval $(uboot/$(1)))
94         $(call Package/uboot/template,$(1),$(TITLE))
95 endef
96
97 ifdef BUILD_VARIANT
98 $(eval $(call uboot/$(BUILD_VARIANT)))
99 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
100 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
101 endif
102
103 define Build/Configure
104         +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
105                 $(UBOOT_CONFIG)_config
106 endef
107
108 define Build/Compile
109         +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
110                 u-boot.kwb \
111                 CROSS_COMPILE=$(TARGET_CROSS)
112         mkimage -A $(ARCH) -O linux -T kernel -C none \
113                 -a 0x600000 -e 0x600000 \
114                 -n 'OpenWrt Das U-Boot uImage' \
115                 -d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img
116 endef
117
118 define Package/uboot/install/default
119         $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
120         $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
121                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
122         $(CP) $(PKG_BUILD_DIR)/u-boot.kwb \
123                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.kwb
124         $(CP) $(PKG_BUILD_DIR)/u-boot.img \
125                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
126         $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
127         $(CP) $(PKG_BUILD_DIR)/tools/kwboot \
128                 $(BIN_DIR)/u-boot-kwboot/
129 endef
130
131 define Package/uboot/install/template
132 define Package/uboot-kirkwood-$(1)/install
133         $(call Package/uboot/install/default,$(2))
134 endef
135 endef
136
137 $(foreach u,$(UBOOTS), \
138         $(eval $(call Package/uboot/install/template,$(u),$(u))) \
139 )
140
141 $(foreach u,$(UBOOTS), \
142         $(eval $(call BuildUBootPackage,$(u))) \
143         $(eval $(call BuildPackage,uboot-kirkwood-$(u))) \
144 )