--- zzzz-none-000/linux-2.6.28.10/Makefile 2009-05-02 18:54:43.000000000 +0000 +++ puma5-6360-529/linux-2.6.28.10/Makefile 2012-03-23 13:35:08.000000000 +0000 @@ -14,7 +14,8 @@ # o use make's built-in rules and variables # (this increases performance and avoids hard-to-debug behaviour); # o print "Entering directory ..."; -MAKEFLAGS += -rR --no-print-directory +# MAKEFLAGS += -rR --no-print-directory +MAKEFLAGS := -rR --no-print-directory # We are using a recursive build, so we need to do a little thinking # to get the ordering right. @@ -149,6 +150,17 @@ srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) TOPDIR := $(srctree) + +HPATH = $(TOPDIR)/include +ifeq ($(KERNEL_LAYOUT),iks) +FUSIV_TOPDIR := fusiv_src +FUSIV_APCODEPATH = $(TOPDIR)/fusiv_src/kernel/ap_code +FUSIV_APINCPATH = $(TOPDIR)/fusiv_src/kernel/ap_code/inc +FUSIV_DRIVERS_INCPATH = $(TOPDIR)/fusiv_src/kernel/drivers/inc +FUSIV_ATM_INCPATH = $(TOPDIR)/fusiv_src/kernel/drivers/adsl +FUSIV_SWITCH_INCPATH = $(TOPDIR)/fusiv_src/kernel/drivers/switch +endif + # FIXME - TOPDIR is obsolete, use srctree/objtree objtree := $(CURDIR) src := $(srctree) @@ -193,6 +205,8 @@ ARCH ?= $(SUBARCH) CROSS_COMPILE ?= +$(warning use: CROSS_COMPILE=$(CROSS_COMPILE)) + # Architecture as present in compile.h UTS_MACHINE := $(ARCH) SRCARCH := $(ARCH) @@ -221,7 +235,7 @@ HOSTCC = gcc HOSTCXX = g++ -HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer HOSTCXXFLAGS = -O2 # Decide whether to build built-in, modular, or both. @@ -325,22 +339,37 @@ CFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS) LDFLAGS_MODULE = -CFLAGS_KERNEL = +CFLAGS_KERNEL = # -save-temps # -v -Wl,--verbose AFLAGS_KERNEL = +# Get GCC Version (using call to Preprocessor) +KERNEL_GCC_VERSION := $(shell echo $$((`echo -e "(__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__" | $(CROSS_COMPILE)gcc -E -P -`))) +# Test for GCC >= 4.6.0 +KBUILD_CFLAGS_GCC40600_ALLOWED := $(shell [ "$(KERNEL_GCC_VERSION)" -ge "40600" ] && echo 1) +ifeq ($(KBUILD_CFLAGS_GCC40600_ALLOWED),1) +# Additional Flags for GCC >= 4.6.0 +KBUILD_CFLAGS_GCC40600 += -Wno-error=unused-but-set-variable +endif # Use LINUXINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option LINUXINCLUDE := -Iinclude \ $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ -I$(srctree)/arch/$(hdr-arch)/include \ - -include include/linux/autoconf.h + -include include/linux/autoconf.h \ + $(EXTRALINUXINCLUDE) -KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) +ifeq ($(KERNEL_LAYOUT),iks) +KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) -DNEW_CONFIG -I$(HPATH) -I$(FUSIV_APCODEPATH) -I$(FUSIV_APINCPATH) -I$(FUSIV_DRIVERS_INCPATH) -I$(FUSIV_ATM_INCPATH) -I$(FUSIV_SWITCH_INCPATH) +else +KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) -DNEW_CONFIG -I$(HPATH) +endif KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ - -fno-strict-aliasing -fno-common \ - -Werror-implicit-function-declaration + -fno-strict-aliasing -fno-common \ + -Werror-implicit-function-declaration \ + $(KBUILD_CFLAGS_GCC40600) + KBUILD_AFLAGS := -D__ASSEMBLY__ # Read KERNELRELEASE from include/config/kernel.release (if it exists) @@ -462,6 +491,9 @@ net-y := net/ libs-y := lib/ core-y := usr/ +ifeq ($(KERNEL_LAYOUT),iks) +fusiv_src-y := fusiv_src/ +endif endif # KBUILD_EXTMOD ifeq ($(dot-config),1) @@ -599,9 +631,8 @@ # relocations required by build roots. This is not defined in the # makefile but the argument can be passed to make if needed. # - MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) -export MODLIB +export MODLIB # # INSTALL_MOD_STRIP, if defined, will cause modules to be @@ -626,17 +657,20 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ - $(net-y) $(net-m) $(libs-y) $(libs-m))) + $(net-y) $(fusiv_src-y) $(net-m) $(libs-y) $(libs-m))) vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ $(init-n) $(init-) \ $(core-n) $(core-) $(drivers-n) $(drivers-) \ - $(net-n) $(net-) $(libs-n) $(libs-)))) + $(net-n) $(net-) $(fusiv_src-y) $(libs-n) $(libs-)))) init-y := $(patsubst %/, %/built-in.o, $(init-y)) core-y := $(patsubst %/, %/built-in.o, $(core-y)) drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y)) net-y := $(patsubst %/, %/built-in.o, $(net-y)) +ifeq ($(KERNEL_LAYOUT),iks) +fusiv_src-y := $(patsubst %/, %/built-in.o, $(fusiv_src-y)) +endif libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) libs-y := $(libs-y1) $(libs-y2) @@ -669,7 +703,7 @@ # System.map is generated to document addresses of all kernel symbols vmlinux-init := $(head-y) $(init-y) -vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y) +vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y) $(fusiv_src-y) vmlinux-all := $(vmlinux-init) $(vmlinux-main) vmlinux-lds := arch/$(SRCARCH)/kernel/vmlinux.lds export KBUILD_VMLINUX_OBJS := $(vmlinux-all) @@ -1088,7 +1122,7 @@ # By default, build modules as well -all: modules +all: modules # Build modules # @@ -1192,6 +1226,14 @@ -o -name '*.symtypes' -o -name 'modules.order' \ -o -name 'Module.markers' -o -name '.tmp_*.o.*' \) \ -type f -print | xargs rm -f +ifeq ($(KERNEL_LAYOUT),iks) + @find . $(FUSIV_TOPDIR) \ + \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ + -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ + -o -name '*.symtypes' -o -name 'modules.order' \ + -o -name 'Module.markers' -o -name '.tmp_*.o.*' \) \ + -type f -print | xargs rm -f +endif # mrproper - Delete all generated files, including .config #