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