Makefile 3.2 KB

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