You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.1 KiB

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