From e820e5cb3aed810fa9ba6047ce9b8bf352335e32 Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Mon, 26 Nov 2012 14:33:09 -0800 Subject: 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 Signed-off-by: Hung-Te Lin Signed-off-by: Stefan Reinauer Change-Id: I349a1fd1d865ef16979f1dfd6aeca12b1ee2eed6 Signed-off-by: Ronald G. Minnich Reviewed-on: http://review.coreboot.org/1915 Reviewed-by: Stefan Reinauer Tested-by: build bot (Jenkins) --- Makefile | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b40574b75a..7df6be816c 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 -- cgit v1.2.3