userspace builds correctly
authorLuigi Rizzo <rizzo@iet.unipi.it>
Sun, 17 Aug 2014 21:46:56 +0000 (14:46 -0700)
committerLuigi Rizzo <rizzo@iet.unipi.it>
Sun, 17 Aug 2014 21:46:56 +0000 (14:46 -0700)
Makefile.openwrt
ipfw/Makefile
kipfw/Makefile

index a916598..8c54bd7 100644 (file)
@@ -17,7 +17,7 @@ MV ?= mv
 include $(INCLUDE_DIR)/package.mk
 
 #Stuff depending on kernel version
 include $(INCLUDE_DIR)/package.mk
 
 #Stuff depending on kernel version
-$(warning -------- -kernel version $(KERNEL) -------)
+$(warning --- openwrt kernel version $(KERNEL) linux dir $(LINUX_DIR) -------)
 
 
 ifeq ($(KERNEL),2.4)
 
 
 ifeq ($(KERNEL),2.4)
@@ -58,19 +58,24 @@ define Build/Prepare
   # $(warning Preparing ipfw sources)
        mkdir -p $(PKG_BUILD_DIR)
        $(CP) -Rp $(IPFW_DIR)/* $(PKG_BUILD_DIR)/
   # $(warning Preparing ipfw sources)
        mkdir -p $(PKG_BUILD_DIR)
        $(CP) -Rp $(IPFW_DIR)/* $(PKG_BUILD_DIR)/
+       # we do not need cross parameters
        (cd $(PKG_BUILD_DIR)/ipfw && $(MAKE) include_e )
        (cd $(PKG_BUILD_DIR)/kipfw && $(MAKE) include_e )
 endef
 
 define Build/Compile
        (cd $(PKG_BUILD_DIR)/ipfw && $(MAKE) include_e )
        (cd $(PKG_BUILD_DIR)/kipfw && $(MAKE) include_e )
 endef
 
 define Build/Compile
-       # compile the userland part for openwrt
+       $(warning  compile the userland part for ipfw/openwrt)
        $(MAKE) -C $(PKG_BUILD_DIR)/ipfw \
        $(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" \
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_WRT) -I./include_e -I./include -include ../glue.h -DNO_ALTQ -D__BSD_VISIBLE" \
-               VER=$(VERS) all
+               _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)" \
        # 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" \
                IPFW3_ROOT="$(PKG_BUILD_DIR)" \
                ARCH="$(LINUX_KARCH)" \
                $(IPFW_SRC_DIR)="$(PKG_BUILD_DIR)/kipfw" \
                IPFW3_ROOT="$(PKG_BUILD_DIR)" \
index a32d02a..358e462 100644 (file)
@@ -6,6 +6,7 @@
 # Do not set with = or := so we can inherit from the caller
 
 include ../Makefile.inc
 # Do not set with = or := so we can inherit from the caller
 
 include ../Makefile.inc
+TARGET := ipfw
 
 all: $(TARGET)
 
 
 all: $(TARGET)
 
@@ -17,7 +18,6 @@ EXTRA_CFLAGS += -Wall
 EXTRA_CFLAGS += -include ../glue.h
 EXTRA_CFLAGS += -I ./include_e -I ./include
 
 EXTRA_CFLAGS += -include ../glue.h
 EXTRA_CFLAGS += -I ./include_e -I ./include
 
-TARGET := ipfw
 ifneq ($(VER),openwrt)
 ifeq ($(OSARCH),Linux)
     EXTRA_CFLAGS += -D__BSD_VISIBLE
 ifneq ($(VER),openwrt)
 ifeq ($(OSARCH),Linux)
     EXTRA_CFLAGS += -D__BSD_VISIBLE
@@ -88,7 +88,7 @@ CFLAGS += -DNO_ALTQ
 #OBJS += altq.o
 
 all: $(TARGET)
 #OBJS += altq.o
 
 all: $(TARGET)
-       -@echo "Done build for $(OSARCH) VER $(VER)"
+       -@echo "Done build for $(OSARCH)"
 
 $(TARGET): $(OBJS)
        $(MSG) "   LD  $@"
 
 $(TARGET): $(OBJS)
        $(MSG) "   LD  $@"
index 431e1f9..697a370 100644 (file)
@@ -42,7 +42,8 @@ TARGET = kipfw
 # lets default for 2.6 for planetlab builds
 VER ?= 2.6
 
 # lets default for 2.6 for planetlab builds
 VER ?= 2.6
 
-$(warning ########## linux dir is $(LINUX_DIR) ###########)
+# $(warning ########## linux dir is $(LINUX_DIR) ###########)
+# $(warning ########## KERNELPATH is $(KERNELPATH) ###########)
 #--- General values for all types of build ---
 # obj-m is the target module
 obj-m := ipfw_mod.o
 #--- General values for all types of build ---
 # obj-m is the target module
 obj-m := ipfw_mod.o