]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
push CROSS_COMPILE out to $(ARCH)_config.mk
authorMike Frysinger <vapier@gentoo.org>
Mon, 15 Jun 2009 03:33:14 +0000 (23:33 -0400)
committerWolfgang Denk <wd@denx.de>
Sun, 19 Jul 2009 19:36:11 +0000 (21:36 +0200)
Each arch should handle setting a proper default CROSS_COMPILE value in
their own config.mk file rather than having to maintain a large ugly list
in the Makefile.  By using conditional assignment, we don't have to worry
about the variable already being set (env/cmdline/etc...).

The common config.mk file takes care of exporting CROSS_COMPILE already,
and while a few variables (toolchain ones) utilize CROSS_COMPILE before
including the arch config.mk, they do so with deferred assignment.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 files changed:
Makefile
arm_config.mk
avr32_config.mk
blackfin_config.mk
i386_config.mk
m68k_config.mk
microblaze_config.mk
mips_config.mk
nios2_config.mk
nios_config.mk
ppc_config.mk
sh_config.mk
sparc_config.mk

index 1eb31773b4cb3b59ce61b921adc6856ce289c098..4fe32328cbed5c4d52c2aac7164c70f5c4173d15 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -151,50 +151,10 @@ ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
 include $(obj)include/config.mk
 export ARCH CPU BOARD VENDOR SOC
 
-ifndef CROSS_COMPILE
+# set default to nothing for native builds
 ifeq ($(HOSTARCH),$(ARCH))
-CROSS_COMPILE =
-else
-ifeq ($(ARCH),ppc)
-CROSS_COMPILE = ppc_8xx-
-endif
-ifeq ($(ARCH),arm)
-CROSS_COMPILE = arm-linux-
-endif
-ifeq ($(ARCH),i386)
-CROSS_COMPILE = i386-linux-
-endif
-ifeq ($(ARCH),mips)
-CROSS_COMPILE = mips_4KC-
-endif
-ifeq ($(ARCH),nios)
-CROSS_COMPILE = nios-elf-
-endif
-ifeq ($(ARCH),nios2)
-CROSS_COMPILE = nios2-elf-
+CROSS_COMPILE ?=
 endif
-ifeq ($(ARCH),m68k)
-CROSS_COMPILE = m68k-elf-
-endif
-ifeq ($(ARCH),microblaze)
-CROSS_COMPILE = mb-
-endif
-ifeq ($(ARCH),blackfin)
-CROSS_COMPILE = bfin-uclinux-
-endif
-ifeq ($(ARCH),avr32)
-CROSS_COMPILE = avr32-linux-
-endif
-ifeq ($(ARCH),sh)
-CROSS_COMPILE = sh4-linux-
-endif
-ifeq ($(ARCH),sparc)
-CROSS_COMPILE = sparc-elf-
-endif  # sparc
-endif  # HOSTARCH,ARCH
-endif  # CROSS_COMPILE
-
-export CROSS_COMPILE
 
 # load other configuration
 include $(TOPDIR)/config.mk
index c4cf99d5079ac7113370780811011841103bcf43..a13603e40917b32db8b9703814bbd01f1e8d3c92 100644 (file)
@@ -21,6 +21,8 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= arm-linux-
+
 PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
 
 LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds
index 441caa405ae3c5e2a8a1c66c0ee5c3970c4480a2..c258b4b55d128b2a819c8aa77a88da0251e024f7 100644 (file)
@@ -21,5 +21,7 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= avr32-linux-
+
 PLATFORM_RELFLAGS      += -ffixed-r5 -fPIC -mno-init-got -mrelax
 PLATFORM_LDFLAGS       += --relax
index 821f082752184bc86ac2ac6240903f62fe23526d..0dd2ac63e15fe683b1d97f7ea44c12e091ee0f93 100644 (file)
@@ -21,6 +21,8 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= bfin-uclinux-
+
 CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU)))
 CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE)))
 CONFIG_ENV_OFFSET := $(strip $(subst ",,$(CONFIG_ENV_OFFSET)))
index 9e6d37d0edb08539db44fb86a0bd216c50fd87c8..5fe36d5f3c98f48be673090add7eafc234b4e489 100644 (file)
@@ -21,4 +21,6 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= i386-linux-
+
 PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__
index 12bd27cb77ff0986d6a00daf45a43adf64422128..f41d1b3c2aa2d70b9d636e19f4045852d271bdf0 100644 (file)
@@ -21,5 +21,7 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= m68k-elf-
+
 PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__
 PLATFORM_LDFLAGS  += -n
index e44c79e05a82e2927a1b98b1659f9c98cc3c098b..68e7e214bf2cf162decdc3f32141d22f0f6f84e9 100644 (file)
@@ -24,4 +24,6 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= mb-
+
 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
index 05eb05d045921e19ac860221e13a62dfd5564622..c785677fc8593f81cc5107f81839548b6b5a864a 100644 (file)
@@ -21,6 +21,8 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= mips_4KC-
+
 PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 
 #
index 3f23b56c934ce93b604a76058e77c567a1de9f4c..59931c25b5f72c8aac578e78c38586e8ebdb77cc 100644 (file)
@@ -22,5 +22,7 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= nios2-elf-
+
 PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__
 PLATFORM_CPPFLAGS += -ffixed-r15 -G0
index 1cf0f323a45a87835b270e1a0a7d71b09646c467..3ed7170b800cd1bee9c97ea8b4fd3385c2de507f 100644 (file)
@@ -22,4 +22,6 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= nios-elf-
+
 PLATFORM_CPPFLAGS += -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs
index c95b3b12edac18bc7c9e890c72f969856ae3c3c8..d91ef7f0b50dfe7d891884110e9084fddaf9e472 100644 (file)
@@ -21,6 +21,8 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= ppc_8xx-
+
 PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
 PLATFORM_LDFLAGS  += -n
 
index 407e076d1bd8352151da3fc115051a693bb5c987..67d7e9e6cc00084923ff8961165133d025e1486d 100644 (file)
@@ -21,6 +21,8 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= sh4-linux-
+
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
 PLATFORM_LDFLAGS += -e $(TEXT_BASE) --defsym reloc_dst=$(TEXT_BASE)
 
index 87f745f6143df7bc7dcf0f0619e4a0c8bfb989d8..07b528c3d5db6bf685b4edb3ebcac1421bb0b70e 100644 (file)
@@ -21,4 +21,6 @@
 # MA 02111-1307 USA
 #
 
+CROSS_COMPILE ?= sparc-elf-
+
 PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__