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