c72439ade47cf41aa762705e38a8fcf87e862e85
[openwrt/openwrt.git] / package / firmware / layerscape / ppa / Makefile
1 #
2 # Copyright 2017 NXP
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:=ppa
12 PKG_VERSION:=2017.09
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL:=https://github.com/yangbolu1991/ppa-binary.git
17 PKG_SOURCE_VERSION:=76a80ca988affbee67bb17096aefb82ba6d91be7
18 PKG_MIRROR_HASH:=76be14a8be9e01036a0e103c8e86d40a6ce4c1a7504930d0d9da54a570744be3
19
20 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
21
22 PKG_FLAGS:=nonshared
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define ppa/Default
27 TITLE:=
28 CONFIG:=
29 endef
30
31 define ppa/ls1043ardb
32 TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board
33 CONFIG=ppa-ls1043a.itb
34 endef
35
36 define ppa/ls1046ardb
37 TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board
38 CONFIG=ppa-ls1046a.itb
39 endef
40
41 define ppa/ls1012ardb
42 TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b/32b Dev Board
43 CONFIG=ppa-ls1012a.itb
44 endef
45
46 define ppa/ls1088ardb
47 TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1088ardb 64b/32b Dev Board
48 CONFIG=ppa-ls1088a.itb
49 endef
50
51 define ppa/ls2088ardb
52 TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls2088ardb 64b/32b Dev Board
53 CONFIG=ppa-ls2088a.itb
54 endef
55
56 define ppa/ls1012afrdm
57 TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012afrdm 64b/32b Dev Board
58 CONFIG=ppa-ls1012a.itb
59 endef
60
61 PPAS := \
62 ls1043ardb \
63 ls1046ardb \
64 ls1012ardb \
65 ls1088ardb \
66 ls2088ardb \
67 ls1012afrdm
68
69 define Package/ppa/template
70 define Package/layerscape-ppa-$(1)
71 SECTION:=firmware
72 CATEGORY:=Firmware
73 DEPENDS:= @TARGET_layerscape
74 TITLE:=$(2)
75 VARIANT:=$(1)
76 endef
77 endef
78
79 define BuildPPAPackage
80 $(eval $(ppa/Default))
81 $(eval $(ppa/$(1)))
82 $(call Package/ppa/template,$(1),$(TITLE))
83 endef
84
85 ifdef BUILD_VARIANT
86 $(eval $(call ppa/$(BUILD_VARIANT)))
87 PPA_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
88 endif
89
90 define Build/Compile
91 endef
92
93 define Package/ppa/install/default
94 $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
95 $(CP) $(PKG_BUILD_DIR)/$(PPA_CONFIG) $(STAGING_DIR_IMAGE)/$(1)-ppa.itb
96 endef
97
98 define Package/ppa/install/template
99 define Package/layerscape-ppa-$(1)/install
100 $(call Package/ppa/install/default,$(2))
101 endef
102 endef
103
104 $(foreach r,$(PPAS), \
105 $(eval $(call Package/ppa/install/template,$(r),$(r))) \
106 )
107
108 $(foreach r,$(PPAS), \
109 $(eval $(call BuildPPAPackage,$(r))) \
110 $(eval $(call BuildPackage,layerscape-ppa-$(r))) \
111 )