Makefile 3.3 KB

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