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