532c7a58ca3fee47a799d442a493447e4af040b8
[openwrt/staging/chunkeey.git] / package / boot / uboot-mxs / Makefile
1 #
2 # Copyright (C) 2013 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:=2015.01
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:=7f08dc9e98a71652bd6968888ed6ec95
20
21 PKG_LICENSE:=GPL-2.0 GPL-2.0+
22 PKG_LICENSE_FILES:=Licenses/README
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define uboot/Default
27 TITLE:=
28 CONFIG:=
29 IMAGE:=
30 endef
31
32 define uboot/mx23_olinuxino
33 TITLE:=U-Boot 2015.01 for the Olinuxino i.MX233
34 endef
35
36 define uboot/duckbill
37 TITLE:=U-Boot 2015.01 for the I2SE Duckbill
38 endef
39
40 UBOOTS := \
41 mx23_olinuxino \
42 duckbill
43
44
45 define Package/uboot/template
46 define Package/uboot-mxs-$(1)
47 SECTION:=boot
48 CATEGORY:=Boot Loaders
49 DEPENDS:=@TARGET_mxs
50 TITLE:=$(2)
51 URL:=http://www.denx.de/wiki/U-Boot
52 VARIANT:=$(1)
53 MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
54 endef
55 endef
56
57 define BuildUBootPackage
58 $(eval $(uboot/Default))
59 $(eval $(uboot/$(1)))
60 $(call Package/uboot/template,$(1),$(TITLE))
61 endef
62
63 ifdef BUILD_VARIANT
64 $(eval $(call uboot/$(BUILD_VARIANT)))
65 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
66 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
67 endif
68
69 define Build/Configure
70 $(MAKE) -C $(PKG_BUILD_DIR) \
71 $(UBOOT_CONFIG)_config
72 endef
73
74 define Build/Compile
75 $(MAKE) -C $(PKG_BUILD_DIR) \
76 CROSS_COMPILE=$(TARGET_CROSS) u-boot.sb
77 endef
78
79
80 define Package/uboot/install/default
81 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
82 dd if=$(PKG_BUILD_DIR)/u-boot.sb of=$(BIN_DIR)/uboot-$(BOARD)-$(1).sb bs=512 seek=4
83 endef
84
85 define Package/uboot/install/template
86 define Package/uboot-mxs-$(1)/install
87 $(call Package/uboot/install/default,$(2))
88 endef
89 endef
90
91 $(foreach u,$(UBOOTS), \
92 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
93 )
94
95 $(foreach u,$(UBOOTS), \
96 $(eval $(call BuildUBootPackage,$(u))) \
97 $(eval $(call BuildPackage,uboot-mxs-$(u))) \
98 )