2012-04-03 04:34:17 +00:00
|
|
|
From: Bastian Blank <waldi@debian.org>
|
|
|
|
Subject: kbuild: Make the toolchain variables easily overwritable
|
|
|
|
Date: Sun, 22 Feb 2009 15:39:35 +0100
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2006-06-13 14:18:29 +00:00
|
|
|
--- a/Makefile
|
|
|
|
+++ b/Makefile
|
2012-07-21 23:32:14 +00:00
|
|
|
@@ -195,42 +195,6 @@ export KBUILD_BUILDHOST := $(SUBARCH)
|
2012-06-04 00:11:03 +00:00
|
|
|
ARCH ?= $(SUBARCH)
|
2010-07-04 20:11:06 +00:00
|
|
|
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
|
2006-09-22 17:17:09 +00:00
|
|
|
|
|
|
|
-# Architecture as present in compile.h
|
2007-11-29 11:12:14 +00:00
|
|
|
-UTS_MACHINE := $(ARCH)
|
|
|
|
-SRCARCH := $(ARCH)
|
|
|
|
-
|
|
|
|
-# Additional ARCH settings for x86
|
|
|
|
-ifeq ($(ARCH),i386)
|
|
|
|
- SRCARCH := x86
|
|
|
|
-endif
|
|
|
|
-ifeq ($(ARCH),x86_64)
|
|
|
|
- SRCARCH := x86
|
|
|
|
-endif
|
2008-08-10 08:35:53 +00:00
|
|
|
-
|
2009-02-19 14:46:05 +00:00
|
|
|
-# Additional ARCH settings for sparc
|
2010-11-28 04:14:29 +00:00
|
|
|
-ifeq ($(ARCH),sparc32)
|
|
|
|
- SRCARCH := sparc
|
|
|
|
-endif
|
2008-08-10 08:35:53 +00:00
|
|
|
-ifeq ($(ARCH),sparc64)
|
2009-02-19 14:46:05 +00:00
|
|
|
- SRCARCH := sparc
|
|
|
|
-endif
|
|
|
|
-
|
2009-04-17 00:41:38 +00:00
|
|
|
-# Additional ARCH settings for sh
|
|
|
|
-ifeq ($(ARCH),sh64)
|
|
|
|
- SRCARCH := sh
|
|
|
|
-endif
|
|
|
|
-
|
2011-05-30 19:21:53 +00:00
|
|
|
-# Additional ARCH settings for tile
|
|
|
|
-ifeq ($(ARCH),tilepro)
|
|
|
|
- SRCARCH := tile
|
|
|
|
-endif
|
|
|
|
-ifeq ($(ARCH),tilegx)
|
|
|
|
- SRCARCH := tile
|
|
|
|
-endif
|
|
|
|
-
|
2009-02-19 14:46:05 +00:00
|
|
|
-# Where to locate arch specific headers
|
|
|
|
-hdr-arch := $(SRCARCH)
|
2006-09-22 17:17:09 +00:00
|
|
|
-
|
|
|
|
KCONFIG_CONFIG ?= .config
|
2011-02-16 13:38:58 +00:00
|
|
|
export KCONFIG_CONFIG
|
2006-09-22 17:17:09 +00:00
|
|
|
|
2012-07-21 23:32:14 +00:00
|
|
|
@@ -349,6 +313,44 @@ CFLAGS_KERNEL =
|
2008-08-10 09:54:20 +00:00
|
|
|
AFLAGS_KERNEL =
|
2009-06-28 12:27:36 +00:00
|
|
|
CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
|
2008-08-10 09:54:20 +00:00
|
|
|
|
2009-02-22 14:39:35 +00:00
|
|
|
+-include $(obj)/.kernelvariables
|
2006-09-22 17:17:09 +00:00
|
|
|
+
|
|
|
|
+# Architecture as present in compile.h
|
2007-11-29 11:12:14 +00:00
|
|
|
+UTS_MACHINE := $(ARCH)
|
|
|
|
+SRCARCH := $(ARCH)
|
|
|
|
+
|
|
|
|
+# Additional ARCH settings for x86
|
|
|
|
+ifeq ($(ARCH),i386)
|
|
|
|
+ SRCARCH := x86
|
|
|
|
+endif
|
|
|
|
+ifeq ($(ARCH),x86_64)
|
|
|
|
+ SRCARCH := x86
|
|
|
|
+endif
|
2008-08-10 08:35:53 +00:00
|
|
|
+
|
2009-02-19 14:46:05 +00:00
|
|
|
+# Additional ARCH settings for sparc
|
2008-08-10 08:35:53 +00:00
|
|
|
+ifeq ($(ARCH),sparc64)
|
2009-02-19 14:46:05 +00:00
|
|
|
+ SRCARCH := sparc
|
2008-08-10 08:35:53 +00:00
|
|
|
+endif
|
2006-06-13 14:18:29 +00:00
|
|
|
+
|
2009-04-17 00:41:38 +00:00
|
|
|
+# Additional ARCH settings for sh
|
|
|
|
+ifeq ($(ARCH),sh64)
|
|
|
|
+ SRCARCH := sh
|
|
|
|
+endif
|
|
|
|
+
|
2011-05-30 19:21:53 +00:00
|
|
|
+# Additional ARCH settings for tile
|
|
|
|
+ifeq ($(ARCH),tilepro)
|
|
|
|
+ SRCARCH := tile
|
|
|
|
+endif
|
|
|
|
+ifeq ($(ARCH),tilegx)
|
|
|
|
+ SRCARCH := tile
|
|
|
|
+endif
|
|
|
|
+
|
2009-02-19 14:46:05 +00:00
|
|
|
+# Where to locate arch specific headers
|
|
|
|
+hdr-arch := $(SRCARCH)
|
|
|
|
+
|
|
|
|
+ifeq ($(ARCH),m68knommu)
|
|
|
|
+ hdr-arch := m68k
|
|
|
|
+endif
|
|
|
|
|
2008-08-10 09:54:20 +00:00
|
|
|
# Use LINUXINCLUDE when you must reference the include/ directory.
|
|
|
|
# Needed to be compatible with the O= option
|