暫無描述

Makefile 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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:=2015-09-21
  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:=885a1b7e2e663b5ab8797db6d40a0318131fdf18
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  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. ifdef CONFIG_USE_MUSL
  65. TARGET_CFLAGS += -D__UCLIBC__
  66. endif
  67. define Build/Compile
  68. $(MAKE) -C $(PKG_BUILD_DIR) \
  69. EXTRA_CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  70. LDFLAGS="$(TARGET_CFLAGS) $(TARGET_LDFLAGS)" \
  71. CROSS="$(TARGET_CROSS)" \
  72. ROOTFS="$(PKG_INSTALL_DIR)" \
  73. OWNER="$(shell id -u $(shell whoami))" \
  74. GROUP="$(shell id -g $(shell whoami))" \
  75. all install
  76. endef
  77. define Package/open-plc-utils/install
  78. endef
  79. define BuildPlugin
  80. define Package/$(1)/install
  81. $(INSTALL_DIR) $$(1)/usr/bin
  82. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/$(subst open-plc-utils-,,$(1)) \
  83. $$(1)/usr/bin/
  84. endef
  85. $$(eval $$(call BuildPackage,$(1)))
  86. endef
  87. $(eval $(call BuildPackage,open-plc-utils))
  88. $(foreach a,$(OPEN_PLC_UTILS_APPS),$(eval $(call BuildPlugin,open-plc-utils-$(a))))