aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 24 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f1d6b20b4..51f460583 100644
--- a/Makefile
+++ b/Makefile
@@ -196,6 +196,28 @@ ARCH ?= $(SUBARCH)
196# Architecture as present in compile.h 196# Architecture as present in compile.h
197UTS_MACHINE := $(ARCH) 197UTS_MACHINE := $(ARCH)
198 198
199HOST_COMPILER ?=
200ifeq ($(HOST_COMPILER),)
201HOST_COMPILER := $(shell grep ^CONFIG_HOST_COMPILER= .config 2>/dev/null)
202HOST_COMPILER := $(subst CONFIG_HOST_COMPILER=,,$(HOST_COMPILER))
203HOST_COMPILER := $(subst ",,$(HOST_COMPILER))
204#")
205endif
206ifeq ($(HOST_COMPILER),)
207HOST_COMPILER := gcc
208endif
209
210CROSS_COMPILER ?=
211ifeq ($(CROSS_COMPILER),)
212CROSS_COMPILER := $(shell grep ^CONFIG_CROSS_COMPILER= .config 2>/dev/null)
213CROSS_COMPILER := $(subst CONFIG_CROSS_COMPILER=,,$(CROSS_COMPILER))
214CROSS_COMPILER := $(subst ",,$(CROSS_COMPILER))
215#")
216endif
217ifeq ($(CROSS_COMPILER),)
218CROSS_COMPILER := gcc
219endif
220
199# SHELL used by kbuild 221# SHELL used by kbuild
200CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ 222CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
201 else if [ -x /bin/bash ]; then echo /bin/bash; \ 223 else if [ -x /bin/bash ]; then echo /bin/bash; \
@@ -275,7 +297,7 @@ export quiet Q KBUILD_VERBOSE
275# Look for make include files relative to root of kernel src 297# Look for make include files relative to root of kernel src
276MAKEFLAGS += --include-dir=$(srctree) 298MAKEFLAGS += --include-dir=$(srctree)
277 299
278HOSTCC = gcc 300HOSTCC = $(HOST_COMPILER)
279HOSTCXX = g++ 301HOSTCXX = g++
280HOSTCFLAGS := 302HOSTCFLAGS :=
281HOSTCXXFLAGS := 303HOSTCXXFLAGS :=
@@ -293,7 +315,7 @@ MAKEFLAGS += -rR
293# Make variables (CC, etc...) 315# Make variables (CC, etc...)
294 316
295AS = $(CROSS_COMPILE)as 317AS = $(CROSS_COMPILE)as
296CC = $(CROSS_COMPILE)gcc 318CC = $(CROSS_COMPILE)$(CROSS_COMPILER)
297LD = $(CC) -nostdlib 319LD = $(CC) -nostdlib
298CPP = $(CC) -E 320CPP = $(CC) -E
299AR = $(CROSS_COMPILE)ar 321AR = $(CROSS_COMPILE)ar