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 #Stuff depending on kernel version
29 CFLAGS_WRT:=-DSYSCTL_NODE -DEMULATE_SYSCTL
35 # Description for the package.
36 # The names KernelPackage/ipfw3 must match the arguments to the
37 # call $(eval $(call KernelPackage,ipfw3)) used to build it
39 define KernelPackage/ipfw3
40 SUBMENU:=Other modules
41 TITLE:= IPFW and dummynet
42 # FILES is what makes up the module, both kernel and userland
43 # It must be in the KernelPackage section
44 FILES := $(PKG_BUILD_DIR)/dummynet2/$(IPFW_MOD) $(PKG_BUILD_DIR)/ipfw/ipfw
45 # AUTOLOAD:=$(call AutoLoad,80,ipfw_mod)
48 define KernelPackage/ipfw3/description
49 This package contains the ipfw and dummynet module
52 # Standard entries for the openwrt builds: Build/Prepare and Build/Compile
53 # Remember that commands must start with a tab
55 # 'prepare' instructions for both kernel and userland
56 # We copy the entire subtree, then build include_e/ which
57 # contains empty headers used by the kernel sources.
59 # $(warning Preparing ipfw sources)
60 mkdir -p $(PKG_BUILD_DIR)
61 $(CP) -Rp $(IPFW_DIR)/* $(PKG_BUILD_DIR)/
62 (cd $(PKG_BUILD_DIR)/ipfw && $(MAKE) include_e )
63 (cd $(PKG_BUILD_DIR)/dummynet2 && $(MAKE) include_e )
67 # compile the kernel part for openwrt
68 $(MAKE) -C "$(LINUX_DIR)" \
69 CROSS_COMPILE="$(TARGET_CROSS)" \
70 ARCH="$(LINUX_KARCH)" \
71 $(IPFW_SRC_DIR)="$(PKG_BUILD_DIR)/dummynet2" \
73 # compile the userland part for openwrt
74 $(MAKE) -C $(PKG_BUILD_DIR)/ipfw \
75 $(TARGET_CONFIGURE_OPTS) \
76 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_WRT) -I./include_e -I./include -include ../glue.h -DNO_ALTQ -D__BSD_VISIBLE" \
80 define Package/ipfw3-userland
84 DESCRIPTION := This is the control program for ipfw and dummynet
87 define Package/ipfw3-userland/install
88 $(INSTALL_DIR) $(1) /sbin
91 # XXX not entirely clear why the install entry for userland works,
92 # given that /sbin/ipfw is in KernelPackage/ipfw3
94 $(eval $(call Package,ipfw3-userland))
95 $(eval $(call KernelPackage,ipfw3))