9554421b26d7a45804a64de5e94eb36ecb6474de
[openwrt/staging/rmilecki.git] / package / boot / uboot-mvebu / Makefile
1 #
2 # Copyright (C) 2016 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:=2016.03
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(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:=973c1d896be751321cc3aafa564f64b2
21
22 PKG_LICENSE:=GPL-2.0 GPL-2.0+
23 PKG_LICENSE_FILES:=Licenses/README
24 PKG_TARGETS:=bin
25
26 PKG_BUILD_PARALLEL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define uboot/Default
31 TITLE:=
32 endef
33
34 define uboot/clearfog
35 TITLE:=U-Boot for SolidRun ClearFog A1
36 endef
37
38 UBOOTS:= \
39 clearfog
40
41 define Package/uboot/template
42 define Package/uboot-mvebu-$(1)
43 SECTION:=boot
44 CATEGORY:=Boot Loaders
45 DEPENDS:=@TARGET_mvebu
46 TITLE:=$(2)
47 URL:=http://www.denx.de/wiki/U-Boot
48 VARIANT:=$(1)
49 MAINTAINER:=Felix Fietkau <nbd@nbd.name>
50 endef
51 endef
52
53 define BuildUBootPackage
54 $(eval $(uboot/Default))
55 $(eval $(uboot/$(1)))
56 $(call Package/uboot/template,$(1),$(TITLE))
57 endef
58
59 define Build/Configure
60 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
61 $(BUILD_VARIANT)_config
62 endef
63
64 define Build/Compile
65 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
66 CROSS_COMPILE=$(TARGET_CROSS) \
67 DTC_DIR=$(LINUX_DIR)/scripts/dtc/
68 endef
69
70 define Package/uboot/install/default
71 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
72 $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \
73 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb
74 $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
75 $(CP) $(PKG_BUILD_DIR)/tools/kwboot \
76 $(BIN_DIR)/u-boot-kwboot/
77 endef
78
79 define Package/uboot/install/template
80 define Package/uboot-mvebu-$(1)/install
81 $(call Package/uboot/install/default,$(2))
82 endef
83 endef
84
85 $(foreach u,$(UBOOTS), \
86 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
87 )
88
89 $(foreach u,$(UBOOTS), \
90 $(eval $(call BuildUBootPackage,$(u))) \
91 $(eval $(call BuildPackage,uboot-mvebu-$(u))) \
92 )