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
|
2013-05-06 22:10:37 +00:00
|
|
|
Forwarded: not-needed
|
2012-04-03 04:34:17 +00:00
|
|
|
|
|
|
|
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
|
2016-06-09 00:55:39 +00:00
|
|
|
@@ -255,42 +255,6 @@ SUBARCH := $(shell uname -m | sed -e s/i
|
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
|
|
|
|
2016-08-28 18:52:50 +00:00
|
|
|
@@ -373,6 +337,44 @@ LDFLAGS_vmlinux =
|
2017-04-19 09:30:57 +00:00
|
|
|
CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
|
2016-08-28 18:52:50 +00:00
|
|
|
CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
|
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
|
|
|
|
|
2012-12-16 15:20:29 +00:00
|
|
|
# Use USERINCLUDE when you must reference the UAPI directories only.
|
|
|
|
USERINCLUDE := \
|