2
0

Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #
  2. # Copyright (C) 2010-2016 Jo-Philipp Wich <jo@mein.io>
  3. #
  4. # This is free software, licensed under the GPL 2 license.
  5. #
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=libiwinfo
  8. PKG_RELEASE:=1
  9. PKG_SOURCE_PROTO:=git
  10. PKG_SOURCE_URL=$(LEDE_GIT)/project/iwinfo.git
  11. PKG_SOURCE_DATE:=2016-09-21
  12. PKG_SOURCE_VERSION:=fd9e17be0c43bd6b8df5371f0b353747bc563874
  13. PKG_MIRROR_HASH:=c58490d9b5c2179f6a3edc67aae2f00ae6007daee0d52fa7e5b4c0ea923f1e37
  14. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_FLAGS := nonshared
  17. PKG_CONFIG_DEPENDS := \
  18. CONFIG_PACKAGE_kmod-brcm-wl \
  19. CONFIG_PACKAGE_kmod-brcm-wl-mini \
  20. CONFIG_PACKAGE_kmod-brcm-wl-mimo \
  21. CONFIG_PACKAGE_kmod-cfg80211
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/libiwinfo
  24. SECTION:=libs
  25. CATEGORY:=Libraries
  26. TITLE:=Generalized Wireless Information Library (iwinfo)
  27. DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny +libuci
  28. ABI_VERSION:=$(PKG_RELEASE)
  29. endef
  30. define Package/libiwinfo/description
  31. Wireless information library with consistent interface for proprietary Broadcom,
  32. nl80211 and wext driver interfaces.
  33. endef
  34. define Package/libiwinfo-lua
  35. SUBMENU:=Lua
  36. SECTION:=lang
  37. CATEGORY:=Languages
  38. TITLE:=libiwinfo Lua binding
  39. DEPENDS:=+libiwinfo +liblua
  40. endef
  41. define Package/libiwinfo-lua/description
  42. This is the Lua binding for the iwinfo library. It provides access to all enabled
  43. backends.
  44. endef
  45. define Package/iwinfo
  46. SECTION:=utils
  47. CATEGORY:=Utilities
  48. TITLE:=Generalized Wireless Information utility
  49. DEPENDS:=+libiwinfo
  50. endef
  51. define Package/iwinfo/description
  52. Command line frontend for the wireless information library.
  53. endef
  54. define Build/Configure
  55. endef
  56. IWINFO_BACKENDS := \
  57. $(if $(CONFIG_PACKAGE_kmod-brcm-wl),wl) \
  58. $(if $(CONFIG_PACKAGE_kmod-brcm-wl-mini),wl) \
  59. $(if $(CONFIG_PACKAGE_kmod-brcm-wl-mimo),wl) \
  60. $(if $(CONFIG_PACKAGE_kmod-cfg80211),nl80211)
  61. TARGET_CFLAGS += \
  62. -I$(STAGING_DIR)/usr/include/libnl-tiny \
  63. -I$(STAGING_DIR)/usr/include \
  64. -D_GNU_SOURCE
  65. MAKE_FLAGS += \
  66. FPIC="$(FPIC)" \
  67. CFLAGS="$(TARGET_CFLAGS)" \
  68. LDFLAGS="$(TARGET_LDFLAGS)" \
  69. BACKENDS="$(IWINFO_BACKENDS)"
  70. define Build/InstallDev
  71. $(INSTALL_DIR) $(1)/usr/include/iwinfo
  72. $(CP) $(PKG_BUILD_DIR)/include/iwinfo.h $(1)/usr/include/
  73. $(CP) $(PKG_BUILD_DIR)/include/iwinfo/* $(1)/usr/include/iwinfo/
  74. $(INSTALL_DIR) $(1)/usr/lib
  75. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libiwinfo.so $(1)/usr/lib/libiwinfo.so
  76. $(INSTALL_DIR) $(1)/usr/lib/lua
  77. $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo.so $(1)/usr/lib/lua/iwinfo.so
  78. endef
  79. define Package/libiwinfo/install
  80. $(INSTALL_DIR) $(1)/usr/lib
  81. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libiwinfo.so $(1)/usr/lib/libiwinfo.so
  82. $(INSTALL_DIR) $(1)/usr/share/libiwinfo
  83. $(INSTALL_DATA) $(PKG_BUILD_DIR)/hardware.txt $(1)/usr/share/libiwinfo/hardware.txt
  84. endef
  85. define Package/libiwinfo-lua/install
  86. $(INSTALL_DIR) $(1)/usr/lib/lua
  87. $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo.so $(1)/usr/lib/lua/iwinfo.so
  88. endef
  89. define Package/iwinfo/install
  90. $(INSTALL_DIR) $(1)/usr/bin
  91. $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo $(1)/usr/bin/iwinfo
  92. endef
  93. $(eval $(call BuildPackage,libiwinfo))
  94. $(eval $(call BuildPackage,libiwinfo-lua))
  95. $(eval $(call BuildPackage,iwinfo))