[ps3]: update compiler version defaults
[openwrt.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:=libnl PACKAGE_wprobe-export:libipfix
14
15 include $(INCLUDE_DIR)/package.mk
16
17 PKG_CONFDEPS = \
18 CONFIG_PACKAGE_kmod-wprobe \
19 CONFIG_PACKAGE_wprobe-export
20
21 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,$(PKG_CONFDEPS))
22
23 define KernelPackage/wprobe
24 SUBMENU:=Network Support
25 TITLE:=Wireless driver probe infrastructure
26 FILES:= \
27 $(PKG_BUILD_DIR)/kernel/wprobe.$(LINUX_KMOD_SUFFIX)
28 AUTOLOAD:=$(call AutoLoad,01,wprobe)
29 endef
30
31 define KernelPackage/wprobe/description
32 A module that exports measurement data from wireless driver to user space
33 endef
34
35 define Package/wprobe-info
36 SECTION:=net
37 CATEGORY:=Network
38 DEPENDS:=+kmod-wprobe
39 TITLE:=Wireless measurement utility
40 endef
41
42 define Package/wprobe-info/description
43 wprobe-info uses the wprobe kernel module to query
44 wireless driver measurement data from an interface
45 endef
46
47 define Package/wprobe-export
48 SECTION:=net
49 CATEGORY:=Network
50 DEPENDS:=+kmod-wprobe
51 TITLE:=Wireless measurement data exporter
52 endef
53
54 define Package/wprobe-export/description
55 wprobe-export uses the wprobe kernel module to export
56 wireless driver measurement data via the IPFIX protocol
57 endef
58
59 define Build/Prepare
60 mkdir -p $(PKG_BUILD_DIR)
61 $(CP) src/* $(PKG_BUILD_DIR)/
62 endef
63
64 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
65
66 ifdef 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
77 endif
78
79 define 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 LIBNL="$(STAGING_DIR)/usr/lib/libnl.a"
86 endef
87
88 ifdef CONFIG_PACKAGE_wprobe-export
89 define Build/Compile/exporter
90 $(MAKE) -C $(PKG_BUILD_DIR)/exporter \
91 $(TARGET_CONFIGURE_OPTS) \
92 CFLAGS="$(TARGET_CFLAGS)" \
93 CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel -I$(PKG_BUILD_DIR)/user" \
94 LDFLAGS="$(TARGET_LDFLAGS)" \
95 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"
96 endef
97 endif
98
99 define Build/Compile
100 $(Build/Compile/kmod)
101 $(Build/Compile/lib)
102 $(Build/Compile/exporter)
103 endef
104
105 define Build/InstallDev
106 $(INSTALL_DIR) $(1)/usr/include
107 $(CP) $(PKG_BUILD_DIR)/kernel/linux $(1)/usr/include
108 endef
109
110 define Package/wprobe-info/install
111 $(INSTALL_DIR) $(1)/sbin
112 $(INSTALL_BIN) $(PKG_BUILD_DIR)/user/wprobe-info $(1)/sbin/
113 endef
114
115 define Package/wprobe-export/install
116 $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d
117 $(INSTALL_BIN) ./files/wprobe.init $(1)/etc/init.d/
118 $(INSTALL_BIN) $(PKG_BUILD_DIR)/exporter/wprobe-export $(1)/sbin/
119 endef
120
121 $(eval $(call KernelPackage,wprobe))
122 $(eval $(call BuildPackage,wprobe-info))
123 $(eval $(call BuildPackage,wprobe-export))
This page took 0.051463 seconds and 5 git commands to generate.