From dd04c1a4b49000418e615319c8295f5e7c25baf6 Mon Sep 17 00:00:00 2001 From: Bastian Blank Date: Sun, 22 Feb 2009 15:39:35 +0100 Subject: [PATCH] kbuild: Make the toolchain variables easily overwritable Allow make variables to be overridden for each flavour by a file in the build tree, .kernelvariables. We currently use this for ARCH, KERNELRELEASE, CC, and in some cases also CROSS_COMPILE, CFLAGS_KERNEL and CFLAGS_MODULE. This file can only be read after we establish the build tree, and all use of $(ARCH) needs to be moved after this. Gbp-Pq: Topic debian Gbp-Pq: Name kernelvariables.patch --- Makefile | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 04916bc0c62..0f554c2c878 100644 --- a/Makefile +++ b/Makefile @@ -358,31 +358,6 @@ include scripts/subarch.include # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile ARCH ?= $(SUBARCH) -# Architecture as present in compile.h -UTS_MACHINE := $(ARCH) -SRCARCH := $(ARCH) - -# Additional ARCH settings for x86 -ifeq ($(ARCH),i386) - SRCARCH := x86 -endif -ifeq ($(ARCH),x86_64) - SRCARCH := x86 -endif - -# Additional ARCH settings for sparc -ifeq ($(ARCH),sparc32) - SRCARCH := sparc -endif -ifeq ($(ARCH),sparc64) - SRCARCH := sparc -endif - -# Additional ARCH settings for sh -ifeq ($(ARCH),sh64) - SRCARCH := sh -endif - KCONFIG_CONFIG ?= .config export KCONFIG_CONFIG @@ -436,6 +411,30 @@ CFLAGS_KERNEL = AFLAGS_KERNEL = LDFLAGS_vmlinux = +-include $(obj)/.kernelvariables + +# Architecture as present in compile.h +UTS_MACHINE := $(ARCH) +SRCARCH := $(ARCH) + +# Additional ARCH settings for x86 +ifeq ($(ARCH),i386) + SRCARCH := x86 +endif +ifeq ($(ARCH),x86_64) + SRCARCH := x86 +endif + +# Additional ARCH settings for sparc +ifeq ($(ARCH),sparc64) + SRCARCH := sparc +endif + +# Additional ARCH settings for sh +ifeq ($(ARCH),sh64) + SRCARCH := sh +endif + # Use USERINCLUDE when you must reference the UAPI directories only. USERINCLUDE := \ -I$(srctree)/arch/$(SRCARCH)/include/uapi \ -- 2.30.2