summaryrefslogtreecommitdiff
path: root/payloads/libpayload/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/Makefile')
-rw-r--r--payloads/libpayload/Makefile32
1 files changed, 29 insertions, 3 deletions
diff --git a/payloads/libpayload/Makefile b/payloads/libpayload/Makefile
index 667822d179..cbfd43a64c 100644
--- a/payloads/libpayload/Makefile
+++ b/payloads/libpayload/Makefile
@@ -79,7 +79,6 @@ HOSTCC = gcc
HOSTCXX = g++
HOSTCFLAGS := -I$(srck) -I$(objk) -g
HOSTCXXFLAGS := -I$(srck) -I$(objk)
-LIBGCC_FILE_NAME := $(shell test -r `$(CC) -print-libgcc-file-name` && $(CC) -print-libgcc-file-name)
DOXYGEN := doxygen
DOXYGEN_OUTPUT_DIR := doxygen
@@ -90,6 +89,35 @@ all: real-all
# Order _does_ matter for pattern rules.
include util/kconfig/Makefile
+include $(HAVE_DOTCONFIG)
+
+ARCHDIR-$(CONFIG_ARCH_ARMV7) := armv7
+ARCHDIR-$(CONFIG_ARCH_POWERPC) := powerpc
+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_ARMV7) := armv7
+ARCH-$(CONFIG_ARCH_ARMV7) := armv7
+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)
+
# Three cases where we don't need fully populated $(obj) lists:
# 1. when no .config exists
# 2. when make config (in any flavour) is run
@@ -110,8 +138,6 @@ real-all: config
else
-include $(HAVE_DOTCONFIG)
-
ifneq ($(INNER_SCANBUILD),y)
ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
CC:=clang -m32