1 # Makefile to build the package in openwrt.
2 # goes into package/ipfw3/Makefile
4 # Edit IPFW_DIR to point to the directory with the sources for ipfw
6 IPFW_DIR := $(TOPDIR)/../ipfw3
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
17 include $(INCLUDE_DIR)/package.mk
19 # Description for the package.
20 # The names KernelPackage/ipfw3 must match the arguments to the
21 # call $(eval $(call KernelPackage,ipfw3)) used to build it
24 define KernelPackage/ipfw3
25 SUBMENU:=Other modules
26 TITLE:= IPFW and dummynet
27 # FILES is what makes up the module, both kernel and userland
28 # It must be in the KernelPackage section
29 FILES := $(PKG_BUILD_DIR)/dummynet2/ipfw_mod.o $(PKG_BUILD_DIR)/ipfw/ipfw
30 # AUTOLOAD:=$(call AutoLoad,80,ipfw_mod)
33 define KernelPackage/ipfw3/description
34 This package contains the ipfw and dummynet module
37 # Standard entries for the openwrt builds: Build/Prepare and Build/Compile
38 # Remember that commands must start with a tab
40 # 'prepare' instructions for both kernel and userland
41 # We copy the entire subtree, then build include_e/ which
42 # contains empty headers used by the kernel sources.
44 # $(warning Preparing ipfw sources)
45 mkdir -p $(PKG_BUILD_DIR)
46 $(CP) -Rp $(IPFW_DIR)/* $(PKG_BUILD_DIR)/
47 (cd $(PKG_BUILD_DIR)/ipfw && $(MAKE) include_e )
48 (cd $(PKG_BUILD_DIR)/dummynet2 && $(MAKE) include_e )
52 # compile the kernel part for openwrt
53 $(MAKE) -C "$(LINUX_DIR)" \
54 CROSS_COMPILE="$(TARGET_CROSS)" \
55 ARCH="$(LINUX_KARCH)" \
56 SUBDIRS="$(PKG_BUILD_DIR)/dummynet2" \
58 # compile the userland part for openwrt
59 $(MAKE) -C $(PKG_BUILD_DIR)/ipfw \
60 $(TARGET_CONFIGURE_OPTS) \
61 CFLAGS="$(TARGET_CFLAGS) -DSYSCTL_NODE -DEMULATE_SYSCTL -I./include_e -I./include -include ../glue.h -DNO_ALTQ" \
65 define Package/ipfw3-userland
69 DESCRIPTION := This is the control program for ipfw and dummynet
72 define Package/ipfw3-userland/install
73 $(INSTALL_DIR) $(1) /sbin
76 # XXX not entirely clear why the install entry for userland works,
77 # given that /sbin/ipfw is in KernelPackage/ipfw3
79 $(eval $(call Package,ipfw3-userland))
80 $(eval $(call KernelPackage,ipfw3))