Merge pull request #4853 from StevenHessing/noddos
[feed/packages.git] / utils / open-plc-utils / Makefile
1 #
2 # Copyright (C) 2013-2015 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:=open-plc-utils
11 PKG_VERSION:=2017-01-15
12 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL:=https://github.com/qca/open-plc-utils.git
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=18b7e2a9a17f043fe8ac8b457680aafb1c249c55
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
19 PKG_MIRROR_HASH:=fd898954f3a7f4f1f1b02a61b748546d648e323642c004353aeb4b337dbaa5dc
20
21 PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
22
23 PKG_LICENSE:=ISC
24 PKG_LICENSE_FILES:=LICENSE
25
26 PKG_BUILD_PARALLEL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/open-plc-utils/Default
31 SECTION:=utils
32 CATEGORY:=Utilities
33 TITLE:=Qualcomm Atheros Power Line Communication utilities
34 URL:=https://github.com/qca/open-plc-utils/blob/master/README
35 endef
36
37 define Package/open-plc-utils
38 $(call Package/open-plc-utils/Default)
39 MENU:=1
40 endef
41
42 define GenPlugin
43 define Package/$(addprefix open-plc-utils-,$(1))
44 $(call Package/open-plc-utils/Default)
45 DEPENDS:=open-plc-utils
46 TITLE:=Utility $(1) from the Open PLC utilities
47 endef
48
49 define Package/$(addprefix open-plc-utils-,$(1))/description
50 Utility $(1) from the Open PLC utilities package.
51 endef
52 endef
53
54 OPEN_PLC_UTILS_APPS:=efbu efeu efru efsu edru edsu nics \
55 hpavkey hpavkeys rkey mac2pw mac2pwd \
56 mdioblock mdioblock2 mdiodump mdiogen \
57 hpav mme \
58 chknvm chknvm2 nvmsplit nvmmerge \
59 chkpib chkpib2 setpib getpib modpib pib2xml \
60 pibcomp pibdump pibruin xml2pib psin psout pskey \
61 psgraph psnotch pibrump \
62 int6k int6kboot int6keth int6kf int6khost \
63 int64host int6kid int6klist int6klog int6kmdio \
64 int6kmdio2 int6kmod int6kstat int6ktest int6krate \
65 int6krule int6ktone int6kwait CMEncrypt sada \
66 coqos_add coqos_info coqos_man coqos_mod coqos_rel \
67 mdustats ampboot amphost ampID amplist amprate \
68 ampstat amptest amptool amptone ampwait \
69 plcboot plchost plcID plclist plcrate plcrule \
70 plcstat plctest plctool plctone \
71 plcwait plchostd plcget plcset plcotst plcfwd \
72 plcdevs plclog plcmdio16 plcmdio32 \
73 config2cfg sdram \
74 int6kuart int6kbaud ttysig ptsctl weeder ttysend \
75 ttyrecv ttycat int6kdetect
76
77 $(foreach a,$(OPEN_PLC_UTILS_APPS),$(eval $(call GenPlugin,$(a))))
78
79 define Build/Compile
80 $(MAKE) -C $(PKG_BUILD_DIR) \
81 EXTRA_CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
82 LDFLAGS="$(TARGET_CFLAGS) $(TARGET_LDFLAGS)" \
83 CROSS="$(TARGET_CROSS)" \
84 ROOTFS="$(PKG_INSTALL_DIR)" \
85 OWNER="$(shell id -u $(shell whoami))" \
86 GROUP="$(shell id -g $(shell whoami))" \
87 all install
88 endef
89
90 define Package/open-plc-utils/install
91 true
92 endef
93
94 define BuildPlugin
95 define Package/$(1)/install
96 $(INSTALL_DIR) $$(1)/usr/bin
97 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/$(subst open-plc-utils-,,$(1)) \
98 $$(1)/usr/bin/
99 endef
100
101 $$(eval $$(call BuildPackage,$(1)))
102 endef
103
104 $(eval $(call BuildPackage,open-plc-utils))
105 $(foreach a,$(OPEN_PLC_UTILS_APPS),$(eval $(call BuildPlugin,open-plc-utils-$(a))))