summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/Makefile.payload20
1 files changed, 14 insertions, 6 deletions
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)"