mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 23:43:42 +02:00
Makefile: move determination tests for target systems to one place
Change-Id: Ia1b3f0257aaeebb355700b65c51a2ba70b80d5ae Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58248 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
parent
8c768c2191
commit
8da9a9acdf
26
Makefile
26
Makefile
@ -158,12 +158,17 @@ ifeq ($(findstring MINGW, $(HOST_OS)), MINGW)
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Determine the destination OS.
|
# Determine the destination OS, architecture and endian
|
||||||
# IMPORTANT: The following line must be placed before TARGET_OS is ever used
|
# IMPORTANT: The following lines must be placed before TARGET_OS, ARCH or ENDIAN
|
||||||
# (of course), but should come after any lines setting CC because the line
|
# is ever used (of course), but should come after any lines setting CC because
|
||||||
# below uses CC itself.
|
# the lines below use CC itself.
|
||||||
override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null \
|
override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null \
|
||||||
| tail -1 | cut -f 2 -d'"'))
|
| tail -1 | cut -f 2 -d'"'))
|
||||||
|
override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null \
|
||||||
|
| tail -1 | cut -f 2 -d'"'))
|
||||||
|
override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null \
|
||||||
|
| tail -1))
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(TARGET_OS), $(filter $(TARGET_OS), FreeBSD OpenBSD DragonFlyBSD))
|
ifeq ($(TARGET_OS), $(filter $(TARGET_OS), FreeBSD OpenBSD DragonFlyBSD))
|
||||||
override CPPFLAGS += -I/usr/local/include
|
override CPPFLAGS += -I/usr/local/include
|
||||||
@ -242,19 +247,6 @@ ifeq ($(TARGET_OS), Linux)
|
|||||||
CONFIG_LINUX_I2C_HELPER = yes
|
CONFIG_LINUX_I2C_HELPER = yes
|
||||||
endif
|
endif
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# General architecture-specific settings.
|
|
||||||
# Like above for the OS, below we verify user-supplied options depending on the target architecture.
|
|
||||||
|
|
||||||
# Determine the destination processor architecture.
|
|
||||||
# IMPORTANT: The following line must be placed before ARCH is ever used
|
|
||||||
# (of course), but should come after any lines setting CC because the line
|
|
||||||
# below uses CC itself.
|
|
||||||
override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null \
|
|
||||||
| tail -1 | cut -f 2 -d'"'))
|
|
||||||
override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null \
|
|
||||||
| tail -1))
|
|
||||||
|
|
||||||
# Disable the internal programmer on unsupported architectures (everything but x86 and mipsel)
|
# Disable the internal programmer on unsupported architectures (everything but x86 and mipsel)
|
||||||
ifneq ($(ARCH)-little, $(filter $(ARCH),x86 mips)-$(ENDIAN))
|
ifneq ($(ARCH)-little, $(filter $(ARCH),x86 mips)-$(ENDIAN))
|
||||||
$(call mark_unsupported,CONFIG_INTERNAL)
|
$(call mark_unsupported,CONFIG_INTERNAL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user