Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Felix Singer: Looks good to me, but someone else must approve Angel Pons: Looks good to me, but someone else must approve
Makefile: Rework the EXEC_SUFFIX determination

Use a conditional function for the statement. This limits the decision
to one line instead of multiple places.

Change-Id: Iee66dbc609bd5c6eb9d04b457f4508911b2e6560
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/62195
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
---
M Makefile
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 3c5ba43..6841552 100644
--- a/Makefile
+++ b/Makefile
@@ -242,9 +242,9 @@
HAS_LINUX_MTD := $(call c_compile_test, Makefile.d/linux_mtd_test.c)
HAS_LINUX_SPI := $(call c_compile_test, Makefile.d/linux_spi_test.c)
HAS_LINUX_I2C := $(call c_compile_test, Makefile.d/linux_i2c_test.c)
+EXEC_SUFFIX := $(strip $(if $(filter $(TARGET_OS), DOS MinGW), .exe))

ifeq ($(TARGET_OS), DOS)
-EXEC_SUFFIX := .exe
# DJGPP has odd uint*_t definitions which cause lots of format string warnings.
override CFLAGS += -Wno-format
override LDFLAGS += -lgetopt
@@ -260,7 +260,6 @@

# FIXME: Should we check for Cygwin/MSVC as well?
ifeq ($(TARGET_OS), MinGW)
-EXEC_SUFFIX := .exe
# MinGW doesn't have the ffs() function, but we can use gcc's __builtin_ffs().
FLASHROM_CFLAGS += -Dffs=__builtin_ffs
# Some functions provided by Microsoft do not work as described in C99 specifications. This macro fixes that

2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.

To view, visit change 62195. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iee66dbc609bd5c6eb9d04b457f4508911b2e6560
Gerrit-Change-Number: 62195
Gerrit-PatchSet: 4
Gerrit-Owner: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: merged