summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 25 insertions, 1 deletions
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