Add more license tags with SPDX identifiers
[openwrt/staging/wigyori.git] / package / boot / uboot-ar71xx / 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:=2010.03
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:=
21 PKG_TARGETS:=bin
22
23 PKG_LICENSE:=GPL-2.0 GPL-2.0+
24 PKG_LICENSE_FILES:=Licenses/README
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define uboot/Default
29 TITLE:=
30 CONFIG:=
31 IMAGE:=
32 endef
33
34 define uboot/nbg460n_550n_550nh
35 TITLE:=U-boot for the NBG460N/550N/550NH routers
36 endef
37
38 UBOOTS:=nbg460n_550n_550nh
39
40 define Package/uboot/template
41 define Package/uboot-ar71xx-$(1)
42 SECTION:=boot
43 CATEGORY:=Boot Loaders
44 TITLE:=$(2)
45 DEPENDS:=@TARGET_ar71xx_generic
46 URL:=http://www.denx.de/wiki/U-Boot
47 DEFAULT:=y if (TARGET_ar71xx_generic_NBG_460N_550N_550NH || TARGET_ar71xx_generic_Default || CONFIG_TARGET_ar71xx_generic_Minimal)
48 VARIANT:=$(1)
49 endef
50 endef
51
52 define BuildUbootPackage
53 $(eval $(uboot/Default))
54 $(eval $(uboot/$(1)))
55 $(call Package/uboot/template,$(1),$(TITLE))
56 endef
57
58
59 ifdef BUILD_VARIANT
60 $(eval $(call uboot/$(BUILD_VARIANT)))
61 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
62 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
63 endif
64
65 define Build/Prepare
66 $(call Build/Prepare/Default)
67 $(CP) ./files/* $(PKG_BUILD_DIR)
68 find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf
69 endef
70
71 define Build/Configure
72 $(MAKE) -C $(PKG_BUILD_DIR) \
73 $(UBOOT_CONFIG)_config
74 endef
75
76 define Build/Compile
77 $(MAKE) -C $(PKG_BUILD_DIR) \
78 CROSS_COMPILE=$(TARGET_CROSS)
79 endef
80
81 define Package/uboot/install/template
82 define Package/uboot-ar71xx-$(1)/install
83 $(INSTALL_DIR) $$(1)
84 $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(BIN_DIR)/$(2)
85 endef
86 endef
87
88 $(foreach u,$(UBOOTS), \
89 $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(SUBTARGET)-$(u)-u-boot.bin)) \
90 )
91
92 $(foreach u,$(UBOOTS), \
93 $(eval $(call BuildUbootPackage,$(u))) \
94 $(eval $(call BuildPackage,uboot-ar71xx-$(u))) \
95 )