506046db4e105451a4d2286c1f160185a9958b9b
[openwrt/openwrt.git] / package / firmware / layerscape / ppfe-firmware / 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
10 PKG_NAME:=ppfe
11 PKG_VERSION:=v1.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_PROTO:=git
15 PKG_MIRROR_HASH:=645d9aaaaa39ac1fa50cf805f1866feb5f717b34cb110c80e3f45303ea6d7259
16 PKG_SOURCE_URL:=https://github.com/fsl-jyt/ppfe.git
17 PKG_SOURCE_VERSION:=b9bb5cc690c0aab2592eb9d443ef55cc9dff8557
18 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19
20 PKG_LICENSE:=GPL-2.0 GPL-2.0+
21 PKG_LICENSE_FILES:=Licenses/README
22
23 PKG_FLAGS:=nonshared
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define ppfe/Default
28 TITLE:=
29 CONFIG:=
30 endef
31
32 define ppfe/ls1012ardb
33 TITLE:=PPFE firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012a Dev Board\
34 (must enable CONFIG_NO_STRIP=y for avoid firmware be broke)
35 CONFIG:=ls1012a/Freescale-Binary-EULA ls1012a/ppfe_class_ls1012a.elf ls1012a/ppfe_tmu_ls1012a.elf
36 endef
37
38 PPFES := \
39 ls1012ardb
40
41 define Package/ppfe/template
42 define Package/ppfe-$(1)
43 SECTION:=firmware
44 CATEGORY:=Firmware
45 DEPENDS:=@TARGET_layerscape
46 TITLE:=$(2)
47 URL:=https://github.com/fsl-jyt/ppfe.git
48 VARIANT:=$(1)
49 MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
50 endef
51 endef
52
53 define BuildPPFEPackage
54 $(eval $(ppfe/Default))
55 $(eval $(ppfe/$(1)))
56 $(call Package/ppfe/template,$(1),$(TITLE))
57 endef
58
59 ifdef BUILD_VARIANT
60 $(eval $(call ppfe/$(BUILD_VARIANT)))
61 PPFE_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
62 endif
63
64 define Build/Compile
65 endef
66
67 define Package/ppfe/install/default
68 $(INSTALL_DIR) $(1)/lib/firmware
69 $(foreach i,$(PPFE_CONFIG), \
70 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(i) $(1)/lib/firmware/ ;\
71 )
72 endef
73
74 define Package/ppfe/install/template
75 define Package/ppfe-$(1)/install
76 $(call Package/ppfe/install/default,$$(1),$(2))
77 endef
78 endef
79
80 $(foreach p,$(PPFES), \
81 $(eval $(call Package/ppfe/install/template,$(p),$(p))) \
82 )
83
84 $(foreach p,$(PPFES), \
85 $(eval $(call BuildPPFEPackage,$(p))) \
86 $(eval $(call BuildPackage,ppfe-$(p))) \
87 )