Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #
  2. # Copyright (C) 2007-2011 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:=iw
  9. PKG_VERSION:=5.19
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@KERNEL/software/network/iw
  13. PKG_HASH:=f167bbe947dd53bb9ebc0c1dcef5db6ad73ac1d6084f2c6f9376c5c360cc4d4e
  14. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_CPE_ID:=cpe:/a:kernel:iw
  17. PKG_BUILD_FLAGS:=gc-sections lto
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/iw
  20. SECTION:=net
  21. CATEGORY:=Network
  22. TITLE:=cfg80211 interface configuration utility
  23. URL:=http://wireless.kernel.org/en/users/Documentation/iw
  24. DEPENDS:= +libnl-tiny
  25. VARIANT:=tiny
  26. endef
  27. define Package/iw-full
  28. $(Package/iw)
  29. TITLE += (full version)
  30. VARIANT:=full
  31. PROVIDES:=iw
  32. endef
  33. define Build/Configure
  34. echo "const char iw_version[] = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/version.c
  35. echo "#!/bin/sh" > $(PKG_BUILD_DIR)/version.sh
  36. chmod +x $(PKG_BUILD_DIR)/version.sh
  37. endef
  38. TARGET_CPPFLAGS:= \
  39. -I$(STAGING_DIR)/usr/include/libnl-tiny \
  40. $(TARGET_CPPFLAGS) \
  41. -DCONFIG_LIBNL20 \
  42. -D_GNU_SOURCE
  43. ifeq ($(BUILD_VARIANT),full)
  44. TARGET_CPPFLAGS += -DIW_FULL
  45. MAKE_FLAGS += IW_FULL=1
  46. endif
  47. MAKE_FLAGS += \
  48. CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  49. LDFLAGS="$(TARGET_LDFLAGS)" \
  50. NL1FOUND="" NL2FOUND=Y \
  51. NLLIBNAME="libnl-tiny" \
  52. LIBS="-lm -lnl-tiny" \
  53. V=1
  54. define Package/iw/install
  55. $(INSTALL_DIR) $(1)/usr/sbin
  56. $(INSTALL_BIN) $(PKG_BUILD_DIR)/iw $(1)/usr/sbin/
  57. endef
  58. Package/iw-full/install=$(Package/iw/install)
  59. $(eval $(call BuildPackage,iw))
  60. $(eval $(call BuildPackage,iw-full))