Makefile.openwrt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. # ====================================================================
  2. #
  3. # Copyright (C) 2013 Qualcomm Atheros, Inc.
  4. #
  5. # Permission to use, copy, modify, and/or distribute this software
  6. # for any purpose with or without fee is hereby granted, provided
  7. # that the above copyright notice and this permission notice appear
  8. # in all copies.
  9. #
  10. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. # WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. # WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
  13. # THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
  14. # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  15. # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  16. # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  17. # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  18. #
  19. # --------------------------------------------------------------------
  20. include $(TOPDIR)/rules.mk
  21. # ====================================================================
  22. #
  23. # --------------------------------------------------------------------
  24. PKG_NAME:=plc-utils
  25. PKG_VERSION:=2.1.5
  26. PKG_RELEASE:=61a5fd6dd8334b7b84436acbf3943bfdd0111a60
  27. # ====================================================================
  28. #
  29. # --------------------------------------------------------------------
  30. PKG_SOURCE_PROTO:=git
  31. PKG_SOURCE_URL:=git://github.qualcomm.com/cmaier/plc-utils.git
  32. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  33. PKG_SOURCE_VERSION:=$(PKG_RELEASE)
  34. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  35. # ====================================================================
  36. #
  37. # --------------------------------------------------------------------
  38. PKG_BUILD_PARALLEL:=1
  39. # ====================================================================
  40. #
  41. # --------------------------------------------------------------------
  42. include $(INCLUDE_DIR)/package.mk
  43. # ====================================================================
  44. #
  45. # --------------------------------------------------------------------
  46. define Package/$(PKG_NAME)/Default
  47. SECTION:=utils
  48. CATEGORY:=Utilities
  49. TITLE:=Qualcomm Atheros Powerline Communication utilities
  50. URL:=https://github.qualcomm.com/cmaier/plc-utils/blob/master/README
  51. MAINTAINER:=Qualcomm Atheros, Ocala FL USA
  52. endef
  53. # ====================================================================
  54. #
  55. # --------------------------------------------------------------------
  56. define Package/$(PKG_NAME)
  57. $(call Package/$(PKG_NAME)/Default)
  58. MENU:=1
  59. endef
  60. # ====================================================================
  61. #
  62. # --------------------------------------------------------------------
  63. define GenPlugin
  64. define Package/plc-utils-$(1)
  65. $(call Package/$(PKG_NAME)/Default)
  66. DEPENDS:=$(PKG_NAME)
  67. TITLE:=Utility $(2) from the PLC utilities
  68. endef
  69. define Package/plc-utils-$(1)/description
  70. Utility $(2) from the Open PLC utilities package.
  71. endef
  72. endef
  73. # ====================================================================
  74. #
  75. # --------------------------------------------------------------------
  76. OPEN_PLC_UTILS_APPS:=CMEncrypt ampID ampboot amphost ampinit amplist amprate ampstat amptest amptone amptool ampwait chknvm chknvm2 chkpib chkpib2 config2cfg coqos_add coqos_info coqos_man coqos_mod coqos_rel edru edsu efbu efeu efru efsu getpib hpav hpavkey hpavkeys int64host int6k int6kbaud int6kboot int6keth int6kf int6khost int6kid int6klist int6klog int6kmdio int6kmdio2 int6kmod int6kp int6krate int6krule int6kstat int6ktest int6ktone int6kuart int6kwait mac2pw mac2pwd mdioblock mdioblock2 mdiodump mdiogen mdustats mme modpib nvmmerge nvmsplit pib2xml pibcomp pibdump pibruin plcID plcboot plcfwd plcget plchost plchostd plcinit plclist plclog plcmdio16 plcmdio32 plcotst plcrate plcrule plcset plcstat plctest plctone plctool plcwait ptsctl rkey sada setpib ttycat ttyrecv ttysend ttysig weeder xml2pib
  77. # ====================================================================
  78. #
  79. # --------------------------------------------------------------------
  80. $(foreach a,$(OPEN_PLC_UTILS_APPS),$(eval $(call GenPlugin,$(a))))
  81. # ====================================================================
  82. #
  83. # --------------------------------------------------------------------
  84. define Build/Compile
  85. $(MAKE) -C $(PKG_BUILD_DIR) \
  86. EXTRA_CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  87. CROSS="$(TARGET_CROSS)" \
  88. ROOTFS="$(PKG_INSTALL_DIR)" \
  89. OWNER="$(shell id -u $(shell whoami))" \
  90. GROUP="$(shell id -g $(shell whoami))" \
  91. all install
  92. endef
  93. # ====================================================================
  94. #
  95. # --------------------------------------------------------------------
  96. define Package/$(PKG_NAME)/install
  97. endef
  98. # ====================================================================
  99. #
  100. # --------------------------------------------------------------------
  101. define BuildPlugin
  102. define Package/$(1)/install
  103. $(INSTALL_DIR) $$(1)/usr/bin
  104. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/$(1) $$(1)/usr/bin/
  105. endef
  106. $$(eval $$(call BuildPackage,$(1)))
  107. endef
  108. # ====================================================================
  109. #
  110. # --------------------------------------------------------------------
  111. $(eval $(call BuildPackage,$(PKG_NAME)))
  112. # ====================================================================
  113. #
  114. # --------------------------------------------------------------------
  115. $(foreach a,$(OPEN_PLC_UTILS_APPS),$(eval $(call BuildPlugin,plc-utils-$(a))))