Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #
  2. # Copyright (C) 2008 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. include $(TOPDIR)/rules.mk
  7. include $(INCLUDE_DIR)/kernel.mk
  8. PKG_NAME:=wprobe
  9. PKG_VERSION:=1
  10. PKG_BUILD_DEPENDS:=libnl libipfix
  11. include $(INCLUDE_DIR)/package.mk
  12. define KernelPackage/wprobe
  13. SUBMENU:=Network Support
  14. TITLE:=Wireless driver probe infrastructure
  15. FILES:= \
  16. $(PKG_BUILD_DIR)/kernel/wprobe.$(LINUX_KMOD_SUFFIX)
  17. AUTOLOAD:=$(call AutoLoad,01,wprobe)
  18. endef
  19. define KernelPackage/wprobe/description
  20. A module that exports measurement data from wireless driver to user space
  21. endef
  22. define Package/wprobe-info
  23. SECTION:=net
  24. CATEGORY:=Network
  25. DEPENDS:=+kmod-wprobe
  26. TITLE:=Wireless measurement utility
  27. endef
  28. define Package/wprobe-info/description
  29. wprobe-info uses the wprobe kernel module to query
  30. wireless driver measurement data from an interface
  31. endef
  32. define Package/wprobe-export
  33. SECTION:=net
  34. CATEGORY:=Network
  35. DEPENDS:=+kmod-wprobe
  36. TITLE:=Wireless measurement data exporter
  37. endef
  38. define Package/wprobe-export/description
  39. wprobe-export uses the wprobe kernel module to export
  40. wireless driver measurement data via the IPFIX protocol
  41. endef
  42. define Build/Prepare
  43. mkdir -p $(PKG_BUILD_DIR)
  44. $(CP) src/* $(PKG_BUILD_DIR)/
  45. endef
  46. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
  47. define Build/Compile/kmod
  48. $(MAKE) -C $(LINUX_DIR) \
  49. CROSS_COMPILE="$(TARGET_CROSS)" \
  50. ARCH="$(LINUX_KARCH)" \
  51. SUBDIRS="$(PKG_BUILD_DIR)/kernel" \
  52. KERNELDIR=$(LINUX_DIR) \
  53. CC="$(TARGET_CC)" \
  54. EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/kernel" \
  55. modules
  56. endef
  57. define Build/Compile/lib
  58. $(MAKE) -C $(PKG_BUILD_DIR)/user \
  59. $(TARGET_CONFIGURE_OPTS) \
  60. CFLAGS="$(TARGET_CFLAGS)" \
  61. CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel" \
  62. LDFLAGS="$(TARGET_LDFLAGS)" \
  63. LIBNL="$(STAGING_DIR)/usr/lib/libnl.a"
  64. endef
  65. define Build/Compile/exporter
  66. $(MAKE) -C $(PKG_BUILD_DIR)/exporter \
  67. $(TARGET_CONFIGURE_OPTS) \
  68. CFLAGS="$(TARGET_CFLAGS)" \
  69. CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel -I$(PKG_BUILD_DIR)/user" \
  70. LDFLAGS="$(TARGET_LDFLAGS)" \
  71. LIBS="$(PKG_BUILD_DIR)/user/libwprobe.a $(STAGING_DIR)/usr/lib/libipfix.a $(STAGING_DIR)/usr/lib/libmisc.a $(STAGING_DIR)/usr/lib/libnl.a -lm"
  72. endef
  73. define Build/Compile
  74. $(Build/Compile/kmod)
  75. $(Build/Compile/lib)
  76. $(Build/Compile/exporter)
  77. endef
  78. define Build/InstallDev
  79. $(INSTALL_DIR) $(1)/usr/include
  80. $(CP) $(PKG_BUILD_DIR)/kernel/linux $(1)/usr/include
  81. endef
  82. define Package/wprobe-info/install
  83. $(INSTALL_DIR) $(1)/sbin
  84. $(INSTALL_BIN) $(PKG_BUILD_DIR)/user/wprobe-info $(1)/sbin/
  85. endef
  86. define Package/wprobe-export/install
  87. $(INSTALL_DIR) $(1)/sbin
  88. $(INSTALL_BIN) $(PKG_BUILD_DIR)/exporter/wprobe-export $(1)/sbin/
  89. endef
  90. $(eval $(call KernelPackage,wprobe))
  91. $(eval $(call BuildPackage,wprobe-info))
  92. $(eval $(call BuildPackage,wprobe-export))