summaryrefslogtreecommitdiffstats
path: root/util/ich_descriptors_tool
diff options
context:
space:
mode:
authorMiklós Márton <martonmiklosqdev@gmail.com>2018-01-30 20:25:00 +0100
committerNico Huber <nico.h@gmx.de>2018-06-23 19:41:49 +0000
commita75a2edc05a006c10caa24ccbee12c2b3ddaee66 (patch)
tree9c1019723c739f5a3e1019bbcb6be88f9d2ff71c /util/ich_descriptors_tool
parent0b59b0dafc219ba73ee2af5404ce626575d74c6f (diff)
downloadflashrom-a75a2edc05a006c10caa24ccbee12c2b3ddaee66.tar.gz
flashrom-a75a2edc05a006c10caa24ccbee12c2b3ddaee66.tar.bz2
flashrom-a75a2edc05a006c10caa24ccbee12c2b3ddaee66.zip
Fix mingw detection on Windows 7 (NT-6.1)
Hopefully also for other non-XP Windows build environments. Change-Id: I7f856dc4847c4ca9197b1935b7a9b9071b46c70a Signed-off-by: Miklós Márton <martonmiklosqdev@gmail.com> Reviewed-on: https://review.coreboot.org/23865 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'util/ich_descriptors_tool')
-rw-r--r--util/ich_descriptors_tool/Makefile17
1 files changed, 10 insertions, 7 deletions
diff --git a/util/ich_descriptors_tool/Makefile b/util/ich_descriptors_tool/Makefile
index d1b5eae92..c32e30be5 100644
--- a/util/ich_descriptors_tool/Makefile
+++ b/util/ich_descriptors_tool/Makefile
@@ -22,6 +22,16 @@ CC ?= gcc
# completely ignored by gnumake.
CFLAGS ?= -Os -Wall -Wshadow
+HOST_OS ?= $(shell uname)
+ifeq ($(findstring MINGW, $(HOST_OS)), MINGW)
+# Explicitly set CC = gcc on MinGW, otherwise: "cc: command not found".
+CC = gcc
+EXEC_SUFFIX := .exe
+# Some functions provided by Microsoft do not work as described in C99 specifications. This macro fixes that
+# for MinGW. See http://sourceforge.net/p/mingw-w64/wiki2/printf%20and%20scanf%20family/ */
+FLASHROM_CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
+endif
+
override TARGET_OS := $(shell $(CC) $(CPPFLAGS) -E $(SHAREDSRCDIR)/os.h | grep -v '^\#' | grep '"' | \
cut -f 2 -d'"')
@@ -31,13 +41,6 @@ EXEC_SUFFIX := .exe
CFLAGS += -Wno-format
endif
-ifeq ($(TARGET_OS), MinGW)
-EXEC_SUFFIX := .exe
-# Some functions provided by Microsoft do not work as described in C99 specifications. This macro fixes that
-# for MinGW. See http://sourceforge.net/p/mingw-w64/wiki2/printf%20and%20scanf%20family/ */
-FLASHROM_CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
-endif
-
ifeq ($(WARNERROR), yes)
CFLAGS += -Werror
endif