Makefile 1.6 KB

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