2 # Copyright (C) 2008 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/kernel.mk
13 PKG_BUILD_DEPENDS
:=libnl PACKAGE_wprobe-export
:libipfix
15 PKG_CONFIG_DEPENDS
= \
16 CONFIG_PACKAGE_kmod-wprobe \
17 CONFIG_PACKAGE_wprobe-export \
19 include $(INCLUDE_DIR
)/package.mk
21 define KernelPackage
/wprobe
22 SUBMENU
:=Network Support
23 TITLE
:=Wireless driver probe infrastructure
25 $(PKG_BUILD_DIR
)/kernel
/wprobe.
$(LINUX_KMOD_SUFFIX
)
26 AUTOLOAD
:=$(call AutoLoad
,01,wprobe
)
29 define KernelPackage
/wprobe
/description
30 A module that exports measurement data from wireless driver to user space
33 define Package
/wprobe-info
37 TITLE
:=Wireless measurement utility
40 define Package
/wprobe-info
/description
41 wprobe-info uses the wprobe kernel module to query
42 wireless driver measurement data from an interface
45 define Package
/wprobe-export
49 TITLE
:=Wireless measurement data exporter
52 define Package
/wprobe-export
/description
53 wprobe-export uses the wprobe kernel module to
export
54 wireless driver measurement data via the IPFIX protocol
58 mkdir
-p
$(PKG_BUILD_DIR
)
59 $(CP
) src
/* $(PKG_BUILD_DIR
)/
62 TARGET_CFLAGS
+= -I
$(STAGING_DIR
)/usr
/include
64 ifdef CONFIG_PACKAGE_kmod-wprobe
65 define Build
/Compile
/kmod
66 $(MAKE
) -C
$(LINUX_DIR
) \
67 CROSS_COMPILE
="$(TARGET_CROSS)" \
68 ARCH
="$(LINUX_KARCH)" \
69 SUBDIRS
="$(PKG_BUILD_DIR)/kernel" \
70 KERNELDIR
=$(LINUX_DIR
) \
72 EXTRA_CFLAGS
="-I$(PKG_BUILD_DIR)/kernel" \
77 define Build
/Compile
/lib
78 $(MAKE
) -C
$(PKG_BUILD_DIR
)/user \
79 $(TARGET_CONFIGURE_OPTS
) \
80 CFLAGS
="$(TARGET_CFLAGS)" \
81 CPPFLAGS
="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel" \
82 LDFLAGS
="$(TARGET_LDFLAGS)" \
83 LIBNL
="$(STAGING_DIR)/usr/lib/libnl.a"
86 ifdef CONFIG_PACKAGE_wprobe-export
87 define Build
/Compile
/exporter
88 $(MAKE
) -C
$(PKG_BUILD_DIR
)/exporter \
89 $(TARGET_CONFIGURE_OPTS
) \
90 CFLAGS
="$(TARGET_CFLAGS)" \
91 CPPFLAGS
="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel -I$(PKG_BUILD_DIR)/user" \
92 LDFLAGS
="$(TARGET_LDFLAGS)" \
93 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"
100 $(Build
/Compile
/exporter
)
103 define Build
/InstallDev
104 $(INSTALL_DIR
) $(1)/usr
/include/wprobe
105 $(CP
) $(PKG_BUILD_DIR
)/kernel
/linux
$(1)/usr
/include/wprobe
108 define Package
/wprobe-info
/install
109 $(INSTALL_DIR
) $(1)/sbin
110 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/user
/wprobe-info
$(1)/sbin
/
113 define Package
/wprobe-export
/install
114 $(INSTALL_DIR
) $(1)/sbin
$(1)/etc
/init.d
115 $(INSTALL_BIN
) .
/files
/wprobe.init
$(1)/etc
/init.d
/
116 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/exporter
/wprobe-export
$(1)/sbin
/
119 $(eval
$(call KernelPackage
,wprobe
))
120 $(eval
$(call BuildPackage
,wprobe-info
))
121 $(eval
$(call BuildPackage
,wprobe-export
))