1 # Makefile to build the package in openwrt.
2 # goes into package/ipfw2/Makefile
4 # Edit IPFW_DIR to point to the directory with the sources for ipfw
6 IPFW_DIR := $(TOPDIR)/../ipfw_mod
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/ipfw2 must match the arguments to the
21 # call $(eval $(call KernelPackage,ipfw2)) used to build it
24 define KernelPackage/ipfw2
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)/dummynet/ipfw_mod.o $(PKG_BUILD_DIR)/ipfw/ipfw
30 # AUTOLOAD:=$(call AutoLoad,80,ipfw_mod)
33 define KernelPackage/ipfw2/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)/dummynet && $(MAKE) include_e )
49 (cd $(PKG_BUILD_DIR)/dummynet2 && $(MAKE) include_e )
53 # compile the kernel part for openwrt
54 $(MAKE) -C "$(LINUX_DIR)" \
55 CROSS_COMPILE="$(TARGET_CROSS)" \
56 ARCH="$(LINUX_KARCH)" \
57 SUBDIRS="$(PKG_BUILD_DIR)/dummynet" \
59 $(MAKE) -C "$(LINUX_DIR)" \
60 CROSS_COMPILE="$(TARGET_CROSS)" \
61 ARCH="$(LINUX_KARCH)" \
62 SUBDIRS="$(PKG_BUILD_DIR)/dummynet2" \
64 # compile the userland part for openwrt
65 $(MAKE) -C $(PKG_BUILD_DIR)/ipfw \
66 $(TARGET_CONFIGURE_OPTS) \
67 CFLAGS="$(TARGET_CFLAGS) -I./include_e -I./include -include ../glue.h" \
71 define Package/ipfw2-userland
75 DESCRIPTION := This is the control program for ipfw and dummynet
78 define Package/ipfw2-userland/install
79 $(INSTALL_DIR) $(1) /sbin
82 # XXX not entirely clear why the install entry for userland works,
83 # given that /sbin/ipfw is in KernelPackage/ipfw2
85 $(eval $(call Package,ipfw2-userland))
86 $(eval $(call KernelPackage,ipfw2))