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
:=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 # XXX: build failure on cris
22 # wprobe-lib.c:145: error: 'packed' attribute ignored for field of type 'struct <anonymous>'
23 # wprobe-lib.c:149: error: 'packed' attribute ignored for field of type 'struct <anonymous>'
25 define Package
/wprobe
/Default
26 DEPENDS
:=@LINUX_2_6 @
(!(TARGET_ps3||TARGET_pxcab||cris
)||BROKEN
)
29 define KernelPackage
/wprobe
30 $(call Package
/wprobe
/Default
)
31 SUBMENU
:=Network Support
32 TITLE
:=Wireless driver probe infrastructure
33 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
35 $(PKG_BUILD_DIR
)/kernel
/wprobe.
$(LINUX_KMOD_SUFFIX
)
36 AUTOLOAD
:=$(call AutoLoad
,01,wprobe
)
39 define KernelPackage
/wprobe
/description
40 A module that exports measurement data from wireless driver to user space
43 define Package
/wprobe-util
44 $(call Package
/wprobe
/Default
)
47 DEPENDS
+=+kmod-wprobe
+libnl-tiny
48 TITLE
:=Wireless measurement utility
51 define Package
/wprobe-util
/description
52 wprobe-util uses the wprobe kernel module to query
53 wireless driver measurement data from an interface
56 define Package
/wprobe-export
57 $(call Package
/wprobe
/Default
)
61 TITLE
:=Wireless measurement data exporter
64 define Package
/wprobe-export
/description
65 wprobe-export uses the wprobe kernel module to
export
66 wireless driver measurement data via the IPFIX protocol
70 mkdir
-p
$(PKG_BUILD_DIR
)
71 $(CP
) src
/* $(PKG_BUILD_DIR
)/
76 -I
$(STAGING_DIR
)/usr
/include/libnl-tiny \
79 ifdef CONFIG_PACKAGE_kmod-wprobe
80 define Build
/Compile
/kmod
81 $(MAKE
) -C
$(LINUX_DIR
) \
82 CROSS_COMPILE
="$(KERNEL_CROSS)" \
83 ARCH
="$(LINUX_KARCH)" \
84 SUBDIRS
="$(PKG_BUILD_DIR)/kernel" \
85 KERNELDIR
=$(LINUX_DIR
) \
87 EXTRA_CFLAGS
="-I$(PKG_BUILD_DIR)/kernel" \
92 define Build
/Compile
/lib
93 $(MAKE
) -C
$(PKG_BUILD_DIR
)/user \
94 $(TARGET_CONFIGURE_OPTS
) \
95 CFLAGS
="$(TARGET_CFLAGS)" \
96 CPPFLAGS
="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel" \
97 LDFLAGS
="$(TARGET_LDFLAGS)" \
102 ifdef CONFIG_PACKAGE_wprobe-export
103 define Build
/Compile
/exporter
104 $(MAKE
) -C
$(PKG_BUILD_DIR
)/exporter \
105 $(TARGET_CONFIGURE_OPTS
) \
106 CFLAGS
="$(TARGET_CFLAGS)" \
107 CPPFLAGS
="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel -I$(PKG_BUILD_DIR)/user" \
108 LDFLAGS
="$(TARGET_LDFLAGS)" \
109 LIBS
="$(PKG_BUILD_DIR)/user/libwprobe.a $(STAGING_DIR)/usr/lib/libipfix.a $(STAGING_DIR)/usr/lib/libmisc.a -lnl-tiny -lm"
114 $(Build
/Compile
/kmod
)
116 $(Build
/Compile
/exporter
)
119 define Build
/InstallDev
120 $(INSTALL_DIR
) $(1)/usr
/include/wprobe
121 $(CP
) $(PKG_BUILD_DIR
)/kernel
/linux
$(1)/usr
/include/wprobe
124 define Package
/wprobe-util
/install
125 $(INSTALL_DIR
) $(1)/sbin
126 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/user
/wprobe-util
$(1)/sbin
/
129 define Package
/wprobe-export
/install
130 $(INSTALL_DIR
) $(1)/sbin
$(1)/etc
/init.d
$(1)/etc
/config
131 $(INSTALL_BIN
) .
/files
/wprobe.init
$(1)/etc
/init.d
/wprobe
132 $(INSTALL_BIN
) .
/files
/wprobe.config
$(1)/etc
/config
/wprobe
133 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/exporter
/wprobe-export
$(1)/sbin
/
136 $(eval
$(call KernelPackage
,wprobe
))
137 $(eval
$(call BuildPackage
,wprobe-util
))
138 $(eval
$(call BuildPackage
,wprobe-export
))