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.

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