aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--util/ich_descriptors_tool/Makefile17
2 files changed, 12 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 943d88d7..746d8d6e 100644
--- a/Makefile
+++ b/Makefile
@@ -93,10 +93,11 @@ debug_shell = $(shell export LC_ALL=C ; { echo 'exec: export LC_ALL=C ; { $(1) ;
# HOST_OS is only used to work around local toolchain issues.
HOST_OS ?= $(shell uname)
-ifeq ($(HOST_OS), MINGW32_NT-5.1)
+ifeq ($(findstring MINGW, $(HOST_OS)), MINGW)
# Explicitly set CC = gcc on MinGW, otherwise: "cc: command not found".
CC = gcc
endif
+
ifneq ($(HOST_OS), SunOS)
STRIP_ARGS = -s
endif
diff --git a/util/ich_descriptors_tool/Makefile b/util/ich_descriptors_tool/Makefile
index d1b5eae9..c32e30be 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