summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2012-11-26 14:33:09 -0800
committerRonald G. Minnich <rminnich@gmail.com>2012-11-27 02:06:07 +0100
commite820e5cb3aed810fa9ba6047ce9b8bf352335e32 (patch)
tree0799c5a295a8f66f15491a95321aa952294bd78f /Makefile
parent534c8a013ff57c2b7dc15f55dea0cf4dbf3ce7bd (diff)
downloadcoreboot-e820e5cb3aed810fa9ba6047ce9b8bf352335e32.tar.gz
coreboot-e820e5cb3aed810fa9ba6047ce9b8bf352335e32.tar.bz2
coreboot-e820e5cb3aed810fa9ba6047ce9b8bf352335e32.zip
Make xcompile support multiple architectures
With this change the the xcompile script now creates environment variables for more than one architecture. Signed-off-by: David Hendricks <dhendrix@chromium.org> Signed-off-by: Hung-Te Lin <hungte@chromium.org> Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Change-Id: I349a1fd1d865ef16979f1dfd6aeca12b1ee2eed6 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/1915 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 25 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b40574b75a6b..7df6be816c5d 100644
--- a/Makefile
+++ b/Makefile
@@ -78,7 +78,6 @@ HOSTCC = gcc
HOSTCXX = g++
HOSTCFLAGS := -g
HOSTCXXFLAGS := -g
-LIBGCC_FILE_NAME := $(shell test -r `$(CC) -print-libgcc-file-name` && $(CC) -print-libgcc-file-name)
DOXYGEN := doxygen
DOXYGEN_OUTPUT_DIR := doxygen
@@ -114,6 +113,31 @@ else
include $(HAVE_DOTCONFIG)
+ARCHDIR-$(CONFIG_ARCH_ARM) := armv7
+ARCHDIR-$(CONFIG_ARCH_X86) := x86
+
+ARCH-y := $(ARCHDIR-y)
+
+# If architecture folder name is different from GCC binutils architecture name,
+# override here.
+ARCH-$(CONFIG_ARCH_ARM) := littlearm
+ARCH-$(CONFIG_ARCH_X86) := i386
+
+CC := $(CC_$(ARCH-y))
+AS := $(AS_$(ARCH-y))
+LD := $(LD_$(ARCH-y))
+NM := $(NM_$(ARCH-y))
+OBJCOPY := $(OBJCOPY_$(ARCH-y))
+OBJDUMP := $(OBJDUMP_$(ARCH-y))
+READELF := $(READELF_$(ARCH-y))
+STRIP := $(STRIP_$(ARCH-y))
+AR := $(AR_$(ARCH-y))
+
+CFLAGS += $(CFLAGS_$(ARCH-y))
+
+LIBGCC_FILE_NAME := $(shell test -r `$(CC) -print-libgcc-file-name` && \
+ $(CC) -print-libgcc-file-name)
+
ifneq ($(INNER_SCANBUILD),y)
ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
CC:=clang -m32 -mno-mmx -mno-sse