78b1c33254c9a6442ede197afa0ba7200647cd5e
[openwrt/staging/yousong.git] / package / boot / uboot-imx6 / Makefile
1 #
2 # Copyright (C) 2013-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.04
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:=6d2116d1385a66e9a59742caa9d62a54
20
21 PKG_LICENSE:=GPL-2.0 GPL-2.0+
22 PKG_LICENSE_FILES:=Licenses/README
23
24 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define uboot/Default
29 TITLE:=
30 CONFIG:=
31 IMAGE:=
32 endef
33
34 define uboot/nitrogen6dl
35 TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board
36 endef
37
38 define uboot/nitrogen6dl2g
39 TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board
40 endef
41
42 define uboot/nitrogen6q
43 TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB)
44 endef
45
46 define uboot/nitrogen6q2g
47 TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board
48 endef
49
50 define uboot/nitrogen6s
51 TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board
52 endef
53
54 define uboot/nitrogen6s1g
55 TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board
56 endef
57
58 define uboot/wandboard_dl
59 TITLE:=U-Boot for the Wandboard Dual Lite
60 endef
61
62 define uboot/wandboard_quad
63 TITLE:=U-Boot for the Wandboard Quad
64 endef
65
66 define uboot/wandboard_solo
67 TITLE:=U-Boot for the Wandboard Solo
68 endef
69
70 UBOOTS := \
71 nitrogen6dl \
72 nitrogen6dl2g \
73 nitrogen6q \
74 nitrogen6q2g \
75 nitrogen6s \
76 nitrogen6s1g \
77 wandboard_dl \
78 wandboard_quad \
79 wandboard_solo
80
81 define Package/uboot/template
82 define Package/uboot-imx6-$(1)
83 SECTION:=boot
84 CATEGORY:=Boot Loaders
85 DEPENDS:=@TARGET_imx6
86 TITLE:=$(2)
87 URL:=http://www.denx.de/wiki/U-Boot
88 VARIANT:=$(1)
89 MAINTAINER:=Luka Perkov <luka@openwrt.org>
90 endef
91 endef
92
93 define BuildUBootPackage
94 $(eval $(uboot/Default))
95 $(eval $(uboot/$(1)))
96 $(call Package/uboot/template,$(1),$(TITLE))
97 endef
98
99 ifdef BUILD_VARIANT
100 $(eval $(call uboot/$(BUILD_VARIANT)))
101 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
102 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
103 endif
104
105 define Build/Configure
106 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
107 $(UBOOT_CONFIG)_config
108 endef
109
110 define Build/Compile
111 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
112 CROSS_COMPILE=$(TARGET_CROSS)
113 endef
114
115 define Package/uboot/install/default
116 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
117 $(CP) \
118 $(PKG_BUILD_DIR)/u-boot.imx \
119 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx
120 endef
121
122 define Package/uboot/install/template
123 define Package/uboot-imx6-$(1)/install
124 $(call Package/uboot/install/default,$(2))
125 endef
126 endef
127
128 $(foreach u,$(UBOOTS), \
129 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
130 )
131
132 $(foreach u,$(UBOOTS), \
133 $(eval $(call BuildUBootPackage,$(u))) \
134 $(eval $(call BuildPackage,uboot-imx6-$(u))) \
135 )