bae9c95b6cc4870598f94b65c105d2638ec074af
[openwrt/openwrt.git] / package / firmware / rcw / Makefile
1 #
2 # Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
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)/image.mk
10
11 PKG_NAME:=rcw
12 PKG_VERSION:=v1.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_PROTO:=git
16 PKG_MIRROR_HASH:=8082979dbdef57e36a3096986aa426ef678c152403eb1dbd132da28f01490b6d
17 PKG_SOURCE_URL:=https://github.com/fsl-jyt/rcw.git
18 PKG_SOURCE_VERSION:=17e09e19bd5cf94e5ebc84916b4607743c29723e
19
20 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
21
22 PKG_LICENSE:=GPL-2.0 GPL-2.0+
23 PKG_LICENSE_FILES:=Licenses/README
24
25 PKG_FLAGS:=nonshared
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define rcw/Default
30 TITLE:=
31 CONFIG:=
32 endef
33
34 define rcw/ls1043ardb
35 TITLE=RCW binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board
36 CONFIG=ls1043ardb-rcw.bin
37 endef
38
39 define rcw/ls1046ardb
40 TITLE=RCW binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board
41 CONFIG=ls1046ardb-rcw.bin
42 endef
43
44 define rcw/ls1012ardb
45 TITLE=RCW binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b/32b Dev Board
46 CONFIG=ls1012ardb-rcw.bin
47 endef
48
49 RCWS := \
50 ls1043ardb \
51 ls1046ardb \
52 ls1012ardb
53
54 define Package/rcw/template
55 define Package/rcw-layerscape-$(1)
56 SECTION:=firmware
57 CATEGORY:=Firmware
58 DEPENDS:= @TARGET_layerscape
59 TITLE:=$(2)
60 URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/rcw.git
61 VARIANT:=$(1)
62 MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
63 endef
64 endef
65
66 define BuildRCWPackage
67 $(eval $(rcw/Default))
68 $(eval $(rcw/$(1)))
69 $(call Package/rcw/template,$(1),$(TITLE))
70 endef
71
72 ifdef BUILD_VARIANT
73 $(eval $(call rcw/$(BUILD_VARIANT)))
74 RCW_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
75 endif
76
77 define Build/Configure
78 endef
79
80 define Build/Compile
81 endef
82
83 define Package/rcw/install/default
84 $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
85 $(CP) $(PKG_BUILD_DIR)/$(RCW_CONFIG) $(STAGING_DIR_IMAGE)/$(1)-rcw.bin
86 endef
87
88 define Package/rcw/install/template
89 define Package/rcw-layerscape-$(1)/install
90 $(call Package/rcw/install/default,$(2))
91 endef
92 endef
93
94 $(foreach r,$(RCWS), \
95 $(eval $(call Package/rcw/install/template,$(r),$(r))) \
96 )
97
98 $(foreach r,$(RCWS), \
99 $(eval $(call BuildRCWPackage,$(r))) \
100 $(eval $(call BuildPackage,rcw-layerscape-$(r))) \
101 )