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

Makefile: move determination test for the architecture to Makefile.d

Move the test code for architecture detection in a extra directory to
split it from the main flashrom code.

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

View File

@ -163,8 +163,7 @@ endif
# is ever used (of course), but should come after any lines setting CC because
# the lines below use CC itself.
override TARGET_OS := $(call c_macro_test, Makefile.d/os_test.h)
override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null \
| tail -1 | cut -f 2 -d'"'))
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))
@ -866,11 +865,8 @@ compiler: featuresavailable
echo "found." || { echo "not found."; \
rm -f .test.c .test$(EXEC_SUFFIX); exit 1; }; } 2>>$(BUILD_DETAILS_FILE); echo $? >&3 ; } | tee -a $(BUILD_DETAILS_FILE) >&4; } 3>&1;} | { read rc ; exit ${rc}; } } 4>&1
@rm -f .test.c .test$(EXEC_SUFFIX)
@printf "Target arch is "
@# FreeBSD wc will output extraneous whitespace.
@echo $(ARCH)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \
( echo "unknown (\"$(ARCH)\"). Aborting."; exit 1)
@printf "%s\n" '$(ARCH)'
@echo Target arch is $(ARCH)
@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
ifeq ($(TARGET_OS), libpayload)