# lets default for 2.6 for planetlab builds
VER ?= 2.6
+# $(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
$(warning ------ arch $(OSARCH) goals $(MAKECMDGOALS) -----------)
ifeq ($(OSARCH),Windows) #--- { Windows block
-ifeq ($(VER),win64)
+ ifeq ($(VER),win64)
$(warning ---- building for 64-bit windows ---)
win_arch= -DAMD64=1
-else
+ else
win_arch= -Di386=1
-endif
+ endif
M ?= $(shell pwd)
WIN_SRCS += md_win.c
WIN_SRCS += miniport.c protocol.c passthru.c debug.c
OUR_PREPROC += -D__BSD_VISIBLE -DIPFIREWALL_DEFAULT_TO_ACCEPT
OUR_PREPROC += -D__LITTLE_ENDIAN -DSYSCTL_NODE -DEMULATE_SYSCTL
-ifeq ($(TCC),) # Microsoft C compiler
+ ifeq ($(TCC),) # Microsoft C compiler
CC = $(DDK)/bin/x86/x86/cl.exe
LD = $(DDK)/bin/x86/x86/link.exe
# #complier options
LIBS += $(DDK)/lib/wxp/i386/wmilib.lib
LIBS += $(DDK)/lib/wxp/i386/ndis.lib
LIBS += $(DDK)/lib/wxp/i386/sehupd.lib
-else # use tcc. not working yet for the kernel module.
+ else # use tcc. not working yet for the kernel module.
# TCC points to the root of tcc tree
CC=$(TCC)/bin/wintcc
EXTRA_CFLAGS += -DTCC -I..
CFLAGS += -include winmissing.h -include missing.h -include ../glue.h
CFLAGS += -I../../inc/api -I../../inc/ddk -I../../inc/crt
CFLAGS += -DRC_INVOKED
-endif # use tcc
+ endif # use tcc
#empty include directory to be built
M ?= $(shell pwd)
grep LINUX_VERSION_CODE $(KERNELPATH)/include/$${G}/linux/version.h | \
awk '{printf "%03x%02x", $$3/256, $$3%256} ')
- # awk '{printf "%d %03x%02d", $$3, $$3/256, $$3%256} ')
- # $(warning version $(LINUX_VERSION_CODE))
- $(warning ------------- linux 2.6 and newer $(LIN_VER) ------------)
+ $(warning ------------- linux version $(LIN_VER) (hex) ------------)
# We have three sections: OpenWrt, Linux 2.4 and Linux 2.6
ifeq ($(LIN_VER),openwrt) #--- { The Makefile section for openwrt ---
- $(error ------ build on openwrt ---------- )
+ # this was used on openwrt, but not anymore
+ $(error ------ build on openwrt ---------- )
# We do not include a dependency on include_e as it is called
# by Makefile.openwrt in Build/Prepare
M=.
# This is the Makefile section for Linux 2.6.x including planetlab
-ifeq ($(IPFW_PLANETLAB),1)
- $(warning "---- Building for PlanetLab")
- ipfw-cflags += -DIPFW_PLANETLAB # PlanetLab compilation
-endif
-# $(warning "---- Building Version 2.6 $(VER) in $(KERNELPATH)")
+ ifeq ($(IPFW_PLANETLAB),1)
+ $(warning "---- Building for PlanetLab")
+ ipfw-cflags += -DIPFW_PLANETLAB # PlanetLab compilation
+ endif
+
WARN := -O1 -Wall -Werror -DDEBUG_SPINLOCK -DDEBUG_MUTEXES
# The main target
endif
# Required by kernel < 2.6.23, ccflags-y is used on newer version
- ifeq ($(shell if [ "$(LIN_VER)" \< "20617" ] ; then echo "true"; fi),true)
+ ifeq ($(shell [ "$(LIN_VER)" \< "20617" ] && echo "true"),true)
EXTRA_CFLAGS += $(ccflags-y)
endif
# $(warning make is $(MAKE) version is $(shell $(MAKE) -version | head -1) )
#--- openwrt ?
- ifeq ($(_VER),openwrt)
+ ifeq ($(_VER),xx-openwrt)
+ $(warning ----------------------- compiling for openwrt -----)
M=.
obj-y := $(IPFW_SRCS:%.c=%.o)
O_TARGET := $(obj-m)