aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2003-06-04 03:27:23 +0200
committerSam Ravnborg <sam@mars.ravnborg.org>2003-06-04 03:27:23 +0200
commitb830d7973c0de3c9b4381b740aeed53cb9875070 (patch)
tree4056d3345271d9028a70642c687b3eed732d4af3 /Makefile
parent9f115a3b66b54aaf3df8e81b7c17c8a2389e3c63 (diff)
downloadhistory-b830d7973c0de3c9b4381b740aeed53cb9875070.tar.gz
kbuild: CROSS_COMPILE and ARCH definitions
Patch originally by Jesse Barnes <jbarnes@sgi.com> Previously the user were required to supply CROSS_COMPILE and ARCH on the commandline to make, alternatively they patched the Makefile direct. The following patch allows the user to specify the value of these in a variable assigned during init or similar.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 24 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ab0a15e92b6d1..5932e5ffe0c8f 100644
--- a/Makefile
+++ b/Makefile
@@ -36,13 +36,36 @@ KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ )
-ARCH := $(SUBARCH)
# Remove hyphens since they have special meaning in RPM filenames
KERNELPATH=kernel-$(subst -,,$(KERNELRELEASE))
+# Cross compiling and selecting different set of gcc/bin-utils
+# ---------------------------------------------------------------------------
+#
+# When performing cross compilation for other architectures ARCH shall be set
+# to the target architecture. (See arch/* for the possibilities).
+# ARCH can be set during invocation of make:
+# make ARCH=ia64
+# Another way is to have ARCH set in the environment.
+# The default ARCH is the host where make is executed.
+
+# CROSS_COMPILE specify the prefix used for all executables used
+# during compilation. Only gcc and related bin-utils executables
+# are prefixed with $(CROSS_COMPILE).
+# CROSS_COMPILE can be set on the command line
+# make CROSS_COMPILE=ia64-linux-
+# Alternatively CROSS_COMPILE can be set in the environment.
+# Default value for CROSS_COMPILE is not to prefix executables
+# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
+
+ARCH ?= $(SUBARCH)
+CROSS_COMPILE ?=
+
+# Architecture as present in compile.h
UTS_MACHINE := $(ARCH)
+# SHELL used by kbuild
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
@@ -53,7 +76,6 @@ HOSTCXX = g++
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
HOSTCXXFLAGS = -O2
-CROSS_COMPILE =
# That's our default target when none is given on the command line
# Note that 'modules' will be added as a prerequisite as well,