Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.9-8fab0c9e
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git
  13. PKG_SOURCE_VERSION:=8fab0c9ee9db217587a58efcc37421c86edcb638
  14. PKG_MIRROR_HASH:=797b322bc03952f3127ae0a7da476c14ada1bbe9a9ae234a56dd6f864c568e16
  15. PKG_MAINTAINER:=Felix Fietkau <[email protected]>
  16. PKG_LICENSE:=GPL-2.0
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/iw
  19. SECTION:=net
  20. CATEGORY:=Network
  21. TITLE:=cfg80211 interface configuration utility
  22. URL:=http://wireless.kernel.org/en/users/Documentation/iw
  23. DEPENDS:= +libnl-tiny
  24. VARIANT:=tiny
  25. endef
  26. define Package/iw-full
  27. $(Package/iw)
  28. TITLE += (full version)
  29. VARIANT:=full
  30. PROVIDES:=iw
  31. endef
  32. define Build/Configure
  33. echo "const char iw_version[] = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/version.c
  34. echo "#!/bin/sh" > $(PKG_BUILD_DIR)/version.sh
  35. chmod +x $(PKG_BUILD_DIR)/version.sh
  36. endef
  37. TARGET_CPPFLAGS:= \
  38. -I$(STAGING_DIR)/usr/include/libnl-tiny \
  39. $(TARGET_CPPFLAGS) \
  40. -DCONFIG_LIBNL20 \
  41. -D_GNU_SOURCE \
  42. -flto
  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) -ffunction-sections -fdata-sections" \
  49. LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections -flto" \
  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))