OSDN Git Service

mediatek: add missing Kconfig
[immortalwrt/immortalwrt.git] / package / kernel / fast-classifier / Makefile
1 include $(TOPDIR)/rules.mk
2 include $(INCLUDE_DIR)/kernel.mk
3
4 PKG_NAME:=fast-classifier
5 PKG_RELEASE:=1
6
7 include $(INCLUDE_DIR)/package.mk
8
9 define KernelPackage/fast-classifier
10   SECTION:=kernel
11   CATEGORY:=Kernel modules
12   SUBMENU:=Network Support
13   TITLE:=Kernel driver for FAST Classifier
14   FILES:=$(PKG_BUILD_DIR)/fast-classifier.ko
15   KCONFIG:= \
16         CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y \
17         CONFIG_NF_CONNTRACK_MARK=y
18   DEPENDS:=+kmod-ipt-conntrack +kmod-shortcut-fe
19   PROVIDES:=fast-classifier
20 endef
21
22 define KernelPackage/fast-classifier/description
23   FAST Classifier talks to SFE to make decisions about offloading connections
24 endef
25
26 define Package/fast-classifier-example
27   SECTION:=net
28   CATEGORY:=Network
29   TITLE:=Example user space program for fast-classifier
30   DEPENDS:=+kmod-fast-classifier +libnl
31 endef
32
33 define Package/fast-classifier-example/description
34   Example user space program that communicates with fast
35   classifier kernel module.
36 endef
37
38 SFE_MAKE_OPTS:=SFE_SUPPORT_IPV6=y
39 EXTRA_CFLAGS+=-I$(STAGING_DIR)/usr/include/shortcut-fe
40
41 define Build/Compile
42         +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" $(strip $(SFE_MAKE_OPTS)) \
43                 $(KERNEL_MAKE_FLAGS) \
44                 $(PKG_MAKE_FLAGS) \
45                 M="$(PKG_BUILD_DIR)" \
46                 CONFIG_FAST_CLASSIFIER=m \
47                 EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
48                 modules
49
50 ifneq ($(CONFIG_PACKAGE_fast-classifier-example),)
51         $(TARGET_CC) -o $(PKG_BUILD_DIR)/userspace_fast_classifier \
52                 -I $(PKG_BUILD_DIR) \
53                 -I$(STAGING_DIR)/usr/include/libnl \
54                 -I$(STAGING_DIR)/usr/include/libnl3 \
55                 -lnl-genl-3 -lnl-3 \
56                 $(PKG_BUILD_DIR)/nl_classifier_test.c
57 endif
58 endef
59
60 define Build/InstallDev
61         $(INSTALL_DIR) $(1)/usr/include
62         $(CP) $(PKG_BUILD_DIR)/fast-classifier.h $(1)/usr/include/
63 endef
64
65 define Package/fast-classifier-example/install
66         $(INSTALL_DIR) $(1)/sbin
67         $(INSTALL_BIN) $(PKG_BUILD_DIR)/userspace_fast_classifier $(1)/sbin/
68 endef
69
70 $(eval $(call KernelPackage,fast-classifier))
71 $(eval $(call BuildPackage,fast-classifier-example))