summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
Diffstat (limited to 'payloads')
-rw-r--r--payloads/coreinfo/Makefile2
-rw-r--r--payloads/libpayload/Makefile.payload20
-rw-r--r--payloads/nvramcui/Makefile1
3 files changed, 14 insertions, 9 deletions
diff --git a/payloads/coreinfo/Makefile b/payloads/coreinfo/Makefile
index 9655e24cc3..c8bf8f09fc 100644
--- a/payloads/coreinfo/Makefile
+++ b/payloads/coreinfo/Makefile
@@ -19,8 +19,6 @@ OBJECTS = cpuinfo_module.o cpuid.S.o pci_module.o coreboot_module.o \
OBJS = $(patsubst %,$(obj)/%,$(OBJECTS))
TARGET = $(obj)/coreinfo.elf
-ARCH := x86_32
-
all: real-all
include ../libpayload/Makefile.payload
diff --git a/payloads/libpayload/Makefile.payload b/payloads/libpayload/Makefile.payload
index 936698760b..d2860bf42d 100644
--- a/payloads/libpayload/Makefile.payload
+++ b/payloads/libpayload/Makefile.payload
@@ -32,14 +32,8 @@ DEFAULT_DEPS += $(PAYLOAD_DEPS)
obj ?= build
-ARCH ?=
OBJS ?=
CCACHE ?=
-
-CFLAGS = $(CFLAGS_$(ARCH))
-CFLAGS += -Os -ffreestanding
-CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror
-
STRIP ?= debug
$(TARGET):
@@ -78,6 +72,20 @@ $(error $(xcompile) deleted because it's invalid. \
Restarting the build should fix that, or explain the problem.)
endif
+ifeq ($(CONFIG_LP_ARCH_ARM),y)
+ARCH ?= arm
+else ifeq ($(CONFIG_LP_ARCH_X86_64),y)
+ARCH ?= x86_64
+else ifeq ($(CONFIG_LP_ARCH_X86_32),y)
+ARCH ?= x86_32
+else ifeq ($(CONFIG_LP_ARCH_ARM64),y)
+ARCH ?= arm64
+endif
+
+CFLAGS = $(CFLAGS_$(ARCH))
+CFLAGS += -Os -ffreestanding
+CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror
+
# `lpgcc` in in-tree mode:
LPGCC = CC="$(CCACHE) $(CC_$(ARCH))"
LPGCC += _OBJ="$(LIBPAYLOAD_OBJ)"
diff --git a/payloads/nvramcui/Makefile b/payloads/nvramcui/Makefile
index cfe279bb54..a0662cf8dc 100644
--- a/payloads/nvramcui/Makefile
+++ b/payloads/nvramcui/Makefile
@@ -1,6 +1,5 @@
unexport $(COREBOOT_EXPORTS)
-ARCH = x86_32
OBJS = $(obj)/nvramcui.o
TARGET = $(obj)/nvramcui.elf