1 # Makefile to build the package in openwrt.
2 # goes into package/network/utils/ipfw3/Makefile
4 # Edit IPFW_DIR to point to the directory with the sources for ipfw
6 IPFW_DIR := $(TOPDIR)/../qemu-misc/ipfw3
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
14 # MV is undefined, we use it in the internal Makefiles
17 include $(INCLUDE_DIR)/package.mk
19 #Stuff depending on kernel version
20 $(warning --- openwrt kernel version $(KERNEL) linux dir $(LINUX_DIR) -------)
24 CFLAGS_WRT:=-DSYSCTL_NODE -DEMULATE_SYSCTL
37 DEPENDS := +libc +libgcc
38 FILES := $(PKG_BUILD_DIR)/ipfw/ipfw
39 $(warning --- build dir is $(PKG_BUILD_DIR) ---)
42 define Package/ipfw3/description
43 Control program for ipfw and dummynet
46 # XXX not entirely clear why the install entry for userland works,
47 # given that /sbin/ipfw is in KernelPackage/ipfw3
49 define Package/ipfw3/install
50 $(INSTALL_DIR) $(1) /sbin
53 # Description for the package.
54 # The names KernelPackage/ipfw3 must match the arguments to the
55 # call $(eval $(call KernelPackage,ipfw3)) used to build it
57 define KernelPackage/ipfw3
58 SUBMENU:=Other modules
59 TITLE:= IPFW and dummynet
60 # FILES is what makes up the module, both kernel and userland
61 # It must be in the KernelPackage section XXX
62 FILES := $(PKG_BUILD_DIR)/kipfw-mod/$(IPFW_MOD)
63 # AUTOLOAD:=$(call AutoLoad,80,ipfw_mod)
66 define KernelPackage/kmod-ipfw3/description
67 ipfw and dummynet kernel module
70 # Standard entries for the openwrt builds: Build/Prepare and Build/Compile
71 # Remember that commands must start with a tab
73 # 'prepare' instructions for both kernel and userland
74 # We copy the entire subtree, then build include_e/ which
75 # contains empty headers used by the kernel sources.
77 # $(warning --- Preparing ipfw sources ---)
78 mkdir -p $(PKG_BUILD_DIR)
79 $(CP) -Rp $(IPFW_DIR)/* $(PKG_BUILD_DIR)/
80 # The kernel sources are spread in multiple places,
81 # so we put everything in kipfw-mod
82 mkdir -p $(PKG_BUILD_DIR)/kipfw-mod
83 cp -Rp $(IPFW_DIR)/kipfw/* $(PKG_BUILD_DIR)/kipfw-mod
84 cp `find $(IPFW_DIR)/sys -name \*.c` $(PKG_BUILD_DIR)/kipfw-mod
85 # we do not need cross parameters
86 (cd $(PKG_BUILD_DIR)/ipfw && $(MAKE) include_e )
87 (cd $(PKG_BUILD_DIR)/kipfw-mod && $(MAKE) include_e )
91 # XXX check whether we need all linux_dir etc.
92 $(warning --- compile the user part for ipfw/openwrt ---)
93 $(MAKE) -C $(PKG_BUILD_DIR)/ipfw \
94 LINUX_DIR=$(LINUX_DIR) \
95 $(TARGET_CONFIGURE_OPTS) \
96 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_WRT) -I./include_e -I./include -include ../glue.h -DNO_ALTQ -D__BSD_VISIBLE" \
98 $(warning --- compile the kernel part for ipfw/openwrt ---)
99 $(MAKE) -C "$(LINUX_DIR)" \
100 CROSS_COMPILE="$(TARGET_CROSS)" \
101 LINUX_DIR=$(LINUX_DIR) \
102 KERNELPATH=$(LINUX_DIR) \
103 ARCH="$(LINUX_KARCH)" \
104 $(IPFW_SRC_DIR)="$(PKG_BUILD_DIR)/kipfw-mod" \
105 IPFW3_ROOT="$(PKG_BUILD_DIR)" \
107 $(warning +++ done compile the kernel part for ipfw/openwrt ---)
111 $(eval $(call BuildPackage,ipfw3))
112 $(eval $(call KernelPackage,ipfw3))