1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 22:43:17 +02:00

Makefile: copy determination test for the endian to Makefile.d

Copy the test code for endian detection in an extra directory to split
it from the main flashrom code.

Change-Id: I0c2420fd60d7d6a23c94c9962b06bfd7f3c86ad8
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/58270
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Thomas Heijligen
2021-10-12 15:54:06 +02:00
committed by Nico Huber
parent cf542aa1ce
commit ba1c5eb125
3 changed files with 92 additions and 8 deletions

View File

@ -164,8 +164,7 @@ endif
# the lines below use CC itself.
override TARGET_OS := $(call c_macro_test, Makefile.d/os_test.h)
override ARCH := $(call c_macro_test, Makefile.d/arch_test.h)
override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null \
| tail -1))
override ENDIAN := $(call c_macro_test, Makefile.d/endian_test.h)
ifeq ($(TARGET_OS), $(filter $(TARGET_OS), FreeBSD OpenBSD DragonFlyBSD))
override CPPFLAGS += -I/usr/local/include
@ -869,6 +868,8 @@ compiler: featuresavailable
@if [ $(ARCH) = unknown ]; then echo Aborting.; exit 1; fi
@echo Target OS is $(TARGET_OS)
@if [ $(TARGET_OS) = unknown ]; then echo Aborting.; exit 1; fi
@echo Target endian is $(ENDIAN)
@if [ $(ENDIAN) = unknown ]; then echo Aborting.; exit 1; fi
ifeq ($(TARGET_OS), libpayload)
@$(CC) --version 2>&1 | grep -q coreboot || \
( echo "Warning: It seems you are not using coreboot's reference compiler."; \