ich_descriptors_tool: Fix target specific flags for MinGW/DJGPP

Make target CFLAGS and binary suffix depend on the target OS, not the
host. Always use FLASHROM_CFLAGS for target-specific flags, as the user
shouldn't override them.

Hopefully fixes https://github.com/flashrom/flashrom/issues/149

Change-Id: I0287247512b5576fa3df20c7d8996d51189dac3c
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72237
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/util/ich_descriptors_tool/Makefile b/util/ich_descriptors_tool/Makefile
index c32e30b..42b950a 100644
--- a/util/ich_descriptors_tool/Makefile
+++ b/util/ich_descriptors_tool/Makefile
@@ -26,10 +26,6 @@
 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 '"' | \
@@ -38,7 +34,14 @@
 ifeq ($(TARGET_OS), DOS)
 EXEC_SUFFIX := .exe
 # DJGPP has odd uint*_t definitions which cause lots of format string warnings.
-CFLAGS += -Wno-format
+FLASHROM_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)