wprobe does not build on linux 2.4
[openwrt/svn-archive/archive.git] / package / wprobe / Makefile
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
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/kernel.mk
9
10 PKG_NAME:=wprobe
11 PKG_VERSION:=1
12
13 PKG_BUILD_DEPENDS:=PACKAGE_wprobe-export:libipfix
14
15 PKG_CONFIG_DEPENDS = \
16 CONFIG_PACKAGE_kmod-wprobe \
17 CONFIG_PACKAGE_wprobe-export \
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define KernelPackage/wprobe
22 SUBMENU:=Network Support
23 TITLE:=Wireless driver probe infrastructure
24 FILES:= \
25 $(PKG_BUILD_DIR)/kernel/wprobe.$(LINUX_KMOD_SUFFIX)
26 AUTOLOAD:=$(call AutoLoad,01,wprobe)
27 DEPENDS:=@!LINUX_2_4
28 endef
29
30 define KernelPackage/wprobe/description
31 A module that exports measurement data from wireless driver to user space
32 endef
33
34 define Package/wprobe-info
35 SECTION:=net
36 CATEGORY:=Network
37 DEPENDS:=+kmod-wprobe +libnl-tiny
38 TITLE:=Wireless measurement utility
39 endef
40
41 define Package/wprobe-info/description
42 wprobe-info uses the wprobe kernel module to query
43 wireless driver measurement data from an interface
44 endef
45
46 define Package/wprobe-export
47 SECTION:=net
48 CATEGORY:=Network
49 DEPENDS:=+kmod-wprobe +libnl-tiny
50 TITLE:=Wireless measurement data exporter
51 endef
52
53 define Package/wprobe-export/description
54 wprobe-export uses the wprobe kernel module to export
55 wireless driver measurement data via the IPFIX protocol
56 endef
57
58 define Build/Prepare
59 mkdir -p $(PKG_BUILD_DIR)
60 $(CP) src/* $(PKG_BUILD_DIR)/
61 endef
62
63 TARGET_CPPFLAGS := \
64 -I$(STAGING_DIR)/usr/include/libnl-tiny \
65 $(TARGET_CPPFLAGS)
66
67 ifdef CONFIG_PACKAGE_kmod-wprobe
68 define Build/Compile/kmod
69 $(MAKE) -C $(LINUX_DIR) \
70 CROSS_COMPILE="$(TARGET_CROSS)" \
71 ARCH="$(LINUX_KARCH)" \
72 SUBDIRS="$(PKG_BUILD_DIR)/kernel" \
73 KERNELDIR=$(LINUX_DIR) \
74 CC="$(TARGET_CC)" \
75 EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/kernel" \
76 modules
77 endef
78 endif
79
80 define Build/Compile/lib
81 $(MAKE) -C $(PKG_BUILD_DIR)/user \
82 $(TARGET_CONFIGURE_OPTS) \
83 CFLAGS="$(TARGET_CFLAGS)" \
84 CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel" \
85 LDFLAGS="$(TARGET_LDFLAGS)" \
86 LIBNL="-lnl-tiny"
87 endef
88
89 ifdef CONFIG_PACKAGE_wprobe-export
90 define Build/Compile/exporter
91 $(MAKE) -C $(PKG_BUILD_DIR)/exporter \
92 $(TARGET_CONFIGURE_OPTS) \
93 CFLAGS="$(TARGET_CFLAGS)" \
94 CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel -I$(PKG_BUILD_DIR)/user" \
95 LDFLAGS="$(TARGET_LDFLAGS)" \
96 LIBS="$(PKG_BUILD_DIR)/user/libwprobe.a $(STAGING_DIR)/usr/lib/libipfix.a $(STAGING_DIR)/usr/lib/libmisc.a -lnl-tiny -lm"
97 endef
98 endif
99
100 define Build/Compile
101 $(Build/Compile/kmod)
102 $(Build/Compile/lib)
103 $(Build/Compile/exporter)
104 endef
105
106 define Build/InstallDev
107 $(INSTALL_DIR) $(1)/usr/include/wprobe
108 $(CP) $(PKG_BUILD_DIR)/kernel/linux $(1)/usr/include/wprobe
109 endef
110
111 define Package/wprobe-info/install
112 $(INSTALL_DIR) $(1)/sbin
113 $(INSTALL_BIN) $(PKG_BUILD_DIR)/user/wprobe-info $(1)/sbin/
114 endef
115
116 define Package/wprobe-export/install
117 $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d
118 $(INSTALL_BIN) ./files/wprobe.init $(1)/etc/init.d/
119 $(INSTALL_BIN) $(PKG_BUILD_DIR)/exporter/wprobe-export $(1)/sbin/
120 endef
121
122 $(eval $(call KernelPackage,wprobe))
123 $(eval $(call BuildPackage,wprobe-info))
124 $(eval $(call BuildPackage,wprobe-export))