source: trunk/package/wprobe/Makefile @ 16730

Last change on this file since 16730 was 16730, checked in by nbd, 7 years ago

rename the wprobe init script to /etc/init.d/wprobe

File size: 3.2 KB
Line 
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
7include $(TOPDIR)/rules.mk
8include $(INCLUDE_DIR)/kernel.mk
9
10PKG_NAME:=wprobe
11PKG_VERSION:=1
12
13PKG_BUILD_DEPENDS:=PACKAGE_wprobe-export:libipfix
14
15PKG_CONFIG_DEPENDS = \
16        CONFIG_PACKAGE_kmod-wprobe \
17        CONFIG_PACKAGE_wprobe-export \
18
19include $(INCLUDE_DIR)/package.mk
20
21define 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)
27endef
28
29define KernelPackage/wprobe/description
30  A module that exports measurement data from wireless driver to user space
31endef
32
33define Package/wprobe-util
34  SECTION:=net
35  CATEGORY:=Network
36  DEPENDS:=+kmod-wprobe +libnl-tiny
37  TITLE:=Wireless measurement utility
38endef
39
40define Package/wprobe-util/description
41  wprobe-util uses the wprobe kernel module to query
42  wireless driver measurement data from an interface
43endef
44
45define Package/wprobe-export
46  SECTION:=net
47  CATEGORY:=Network
48  DEPENDS:=+wprobe-util
49  TITLE:=Wireless measurement data exporter
50endef
51
52define Package/wprobe-export/description
53  wprobe-export uses the wprobe kernel module to export
54  wireless driver measurement data via the IPFIX protocol
55endef
56
57define Build/Prepare
58        mkdir -p $(PKG_BUILD_DIR)
59        $(CP) src/* $(PKG_BUILD_DIR)/
60endef
61
62TARGET_CPPFLAGS := \
63        -I$(STAGING_DIR)/usr/include/libnl-tiny \
64        $(TARGET_CPPFLAGS)
65
66ifdef CONFIG_PACKAGE_kmod-wprobe
67  define Build/Compile/kmod
68        $(MAKE) -C $(LINUX_DIR) \
69                CROSS_COMPILE="$(TARGET_CROSS)" \
70                ARCH="$(LINUX_KARCH)" \
71                SUBDIRS="$(PKG_BUILD_DIR)/kernel" \
72                KERNELDIR=$(LINUX_DIR) \
73                CC="$(TARGET_CC)" \
74                EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/kernel" \
75                modules
76  endef
77endif
78
79define Build/Compile/lib
80        $(MAKE) -C $(PKG_BUILD_DIR)/user \
81                $(TARGET_CONFIGURE_OPTS) \
82                CFLAGS="$(TARGET_CFLAGS)" \
83                CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel" \
84                LDFLAGS="$(TARGET_LDFLAGS)" \
85                HOST_OS=Linux \
86                LIBNL="-lnl-tiny"
87endef
88
89ifdef 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
98endif
99
100define Build/Compile
101        $(Build/Compile/kmod)
102        $(Build/Compile/lib)
103        $(Build/Compile/exporter)
104endef
105
106define Build/InstallDev
107        $(INSTALL_DIR) $(1)/usr/include/wprobe
108        $(CP) $(PKG_BUILD_DIR)/kernel/linux $(1)/usr/include/wprobe
109endef
110
111define Package/wprobe-util/install
112        $(INSTALL_DIR) $(1)/sbin
113        $(INSTALL_BIN) $(PKG_BUILD_DIR)/user/wprobe-util $(1)/sbin/
114endef
115
116define Package/wprobe-export/install
117        $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d $(1)/etc/config
118        $(INSTALL_BIN) ./files/wprobe.init $(1)/etc/init.d/wprobe
119        $(INSTALL_BIN) ./files/wprobe.config $(1)/etc/config/wprobe
120        $(INSTALL_BIN) $(PKG_BUILD_DIR)/exporter/wprobe-export $(1)/sbin/
121endef
122
123$(eval $(call KernelPackage,wprobe))
124$(eval $(call BuildPackage,wprobe-util))
125$(eval $(call BuildPackage,wprobe-export))
Note: See TracBrowser for help on using the repository browser.