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 libipfix
15 include $(INCLUDE_DIR
)/package.mk
17 define KernelPackage
/wprobe
18 SUBMENU
:=Network Support
19 TITLE
:=Wireless driver probe infrastructure
21 $(PKG_BUILD_DIR
)/kernel
/wprobe.
$(LINUX_KMOD_SUFFIX
)
22 AUTOLOAD
:=$(call AutoLoad
,01,wprobe
)
25 define KernelPackage
/wprobe
/description
26 A module that exports measurement data from wireless driver to user space
29 define Package
/wprobe-info
33 TITLE
:=Wireless measurement utility
36 define Package
/wprobe-info
/description
37 wprobe-info uses the wprobe kernel module to query
38 wireless driver measurement data from an interface
41 define Package
/wprobe-export
45 TITLE
:=Wireless measurement data exporter
48 define Package
/wprobe-export
/description
49 wprobe-export uses the wprobe kernel module to
export
50 wireless driver measurement data via the IPFIX protocol
54 mkdir
-p
$(PKG_BUILD_DIR
)
55 $(CP
) src
/* $(PKG_BUILD_DIR
)/
58 TARGET_CFLAGS
+= -I
$(STAGING_DIR
)/usr
/include
60 define Build
/Compile
/kmod
61 $(MAKE
) -C
$(LINUX_DIR
) \
62 CROSS_COMPILE
="$(TARGET_CROSS)" \
63 ARCH
="$(LINUX_KARCH)" \
64 SUBDIRS
="$(PKG_BUILD_DIR)/kernel" \
65 KERNELDIR
=$(LINUX_DIR
) \
67 EXTRA_CFLAGS
="-I$(PKG_BUILD_DIR)/kernel" \
71 define Build
/Compile
/lib
72 $(MAKE
) -C
$(PKG_BUILD_DIR
)/user \
73 $(TARGET_CONFIGURE_OPTS
) \
74 CFLAGS
="$(TARGET_CFLAGS)" \
75 CPPFLAGS
="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel" \
76 LDFLAGS
="$(TARGET_LDFLAGS)" \
77 LIBNL
="$(STAGING_DIR)/usr/lib/libnl.a"
80 define Build
/Compile
/exporter
81 $(MAKE
) -C
$(PKG_BUILD_DIR
)/exporter \
82 $(TARGET_CONFIGURE_OPTS
) \
83 CFLAGS
="$(TARGET_CFLAGS)" \
84 CPPFLAGS
="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel -I$(PKG_BUILD_DIR)/user" \
85 LDFLAGS
="$(TARGET_LDFLAGS)" \
86 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"
92 $(Build
/Compile
/exporter
)
95 define Build
/InstallDev
96 $(INSTALL_DIR
) $(1)/usr
/include
97 $(CP
) $(PKG_BUILD_DIR
)/kernel
/linux
$(1)/usr
/include
100 define Package
/wprobe-info
/install
101 $(INSTALL_DIR
) $(1)/sbin
102 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/user
/wprobe-info
$(1)/sbin
/
105 define Package
/wprobe-export
/install
106 $(INSTALL_DIR
) $(1)/sbin
107 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/exporter
/wprobe-export
$(1)/sbin
/
110 $(eval
$(call KernelPackage
,wprobe
))
111 $(eval
$(call BuildPackage
,wprobe-info
))
112 $(eval
$(call BuildPackage
,wprobe-export
))