X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile.openwrt;h=5ccb268398b865f75491193748cd2ad2ddd21e46;hb=a6a16b4403951d0108724160ba7b9593f77e4aaa;hp=16f786fc11fbb4f7559e27d31d28d1b40e94df4f;hpb=13fea6898392b2a2bc0d51ba795f8d49cce0eab3;p=ipfw-google.git diff --git a/Makefile.openwrt b/Makefile.openwrt index 16f786f..5ccb268 100644 --- a/Makefile.openwrt +++ b/Makefile.openwrt @@ -1,5 +1,5 @@ # Makefile to build the package in openwrt. -# goes into package/ipfw3/Makefile +# goes into package/network/utils/ipfw3/Makefile # # Edit IPFW_DIR to point to the directory with the sources for ipfw @@ -17,19 +17,17 @@ MV ?= mv include $(INCLUDE_DIR)/package.mk #Stuff depending on kernel version -ifeq ($(KERNEL),2.6) - -VERS:=2.6 -IPFW_MOD:=ipfw_mod.ko -IPFW_SRC_DIR:=M +$(warning --- openwrt kernel version $(KERNEL) linux dir $(LINUX_DIR) -------) +ifeq ($(KERNEL),2.4) + VERS:=openwrt + CFLAGS_WRT:=-DSYSCTL_NODE -DEMULATE_SYSCTL + IPFW_MOD:=ipfw_mod.o + IPFW_SRC_DIR:=SUBDIRS else - -VERS:=openwrt -CFLAGS_WRT:=-DSYSCTL_NODE -DEMULATE_SYSCTL -IPFW_MOD:=ipfw_mod.o -IPFW_SRC_DIR:=SUBDIRS - + #VERS:=2.6 + IPFW_MOD:=ipfw_mod.ko + IPFW_SRC_DIR:=M endif # Description for the package. @@ -41,7 +39,7 @@ define KernelPackage/ipfw3 TITLE:= IPFW and dummynet # FILES is what makes up the module, both kernel and userland # It must be in the KernelPackage section - FILES := $(PKG_BUILD_DIR)/kipfw/$(IPFW_MOD) $(PKG_BUILD_DIR)/ipfw/ipfw + FILES := $(PKG_BUILD_DIR)/kipfw-mod/$(IPFW_MOD) $(PKG_BUILD_DIR)/ipfw/ipfw # AUTOLOAD:=$(call AutoLoad,80,ipfw_mod) endef @@ -59,23 +57,38 @@ define Build/Prepare # $(warning Preparing ipfw sources) mkdir -p $(PKG_BUILD_DIR) $(CP) -Rp $(IPFW_DIR)/* $(PKG_BUILD_DIR)/ + # The kernel sources are spread in multiple places, + # so we put everything in kipfw-mod + mkdir -p $(PKG_BUILD_DIR)/kipfw-mod + cp -Rp $(IPFW_DIR)/kipfw/* $(PKG_BUILD_DIR)/kipfw-mod + cp `find $(IPFW_DIR)/sys -name \*.c` $(PKG_BUILD_DIR)/kipfw-mod + # we do not need cross parameters (cd $(PKG_BUILD_DIR)/ipfw && $(MAKE) include_e ) - (cd $(PKG_BUILD_DIR)/kipfw && $(MAKE) include_e ) + (cd $(PKG_BUILD_DIR)/kipfw-mod && $(MAKE) include_e ) endef define Build/Compile + # XXX check whether we need all linux_dir etc. + $(MAKE) -C $(PKG_BUILD_DIR)/ipfw \ + LINUX_DIR=$(LINUX_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_WRT) -I./include_e -I./include -include ../glue.h -DNO_ALTQ -D__BSD_VISIBLE" \ + _VER=$(VERS) all + $(warning compile the kernel part for ipfw/openwrt) # compile the kernel part for openwrt $(MAKE) -C "$(LINUX_DIR)" \ CROSS_COMPILE="$(TARGET_CROSS)" \ + LINUX_DIR=$(LINUX_DIR) \ + KERNELPATH=$(LINUX_DIR) \ ARCH="$(LINUX_KARCH)" \ - $(IPFW_SRC_DIR)="$(PKG_BUILD_DIR)/kipfw" \ + $(IPFW_SRC_DIR)="$(PKG_BUILD_DIR)/kipfw-mod" \ IPFW3_ROOT="$(PKG_BUILD_DIR)" \ _VER=$(VERS) modules - # compile the userland part for openwrt - $(MAKE) -C $(PKG_BUILD_DIR)/ipfw \ - $(TARGET_CONFIGURE_OPTS) \ - CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_WRT) -I./include_e -I./include -include ../glue.h -DNO_ALTQ -D__BSD_VISIBLE" \ - _VER=$(VERS) all +endef + +define Build/Compile_new + $(call Build/Compile/Default) + $(call Build/Compile/Default,modules) endef define Package/ipfw3-userland