path: root/Makefile
diff options
authorUwe Hermann <>2011-08-20 14:16:00 +0000
committerUwe Hermann <>2011-08-20 14:16:00 +0000
commit44ffd58aa375d0293dea7aefef8511c0b4c814d0 (patch)
treee50bb73a0025f56c3ea9b04a6d157f0161785d3a /Makefile
parent394ee7832569431352d5f6f70ab345a6b4dd9fa8 (diff)
Makefile: Fix MinGW build, improve output with bogus CC
As per IRC discussion, the "ARCH :=" line should be moved after any lines which set CC, as it uses CC itself. This fixes the MinGW build. Also, add a "2>/dev/null" in the "ARCH :=" as per suggestion from Stefan Tauner to improve the output in the case CC is bogus: Before: $ make CC=foo /bin/sh: foo: not found Checking for a C compiler... not found. make: *** [compiler] Error 1 After: $ make CC=foo Checking for a C compiler... not found. make: *** [compiler] Error 1 Corresponding to flashrom svn r1418. Signed-off-by: Uwe Hermann <> Acked-by: Stefan Tauner <>
Diffstat (limited to 'Makefile')
1 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 26f978f..9ad9d95 100644
--- a/Makefile
+++ b/Makefile
@@ -37,9 +37,6 @@ ifeq ($(WARNERROR), yes)
CFLAGS += -Werror
-# Determine the destination processor architecture
-override ARCH := $(strip $(shell LC_ALL=C $(CC) -E arch.h|grep -v '^\#'))
# FIXME We have to differentiate between host and target OS architecture.
OS_ARCH ?= $(shell uname)
ifneq ($(OS_ARCH), SunOS)
@@ -202,6 +199,12 @@ override CONFIG_FT2232_SPI = no
+# 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. In some cases we set CC based on OS_ARCH, see above.
+override ARCH := $(strip $(shell LC_ALL=C $(CC) -E arch.h 2>/dev/null | grep -v '^\#'))
ifeq ($(ARCH), "ppc")
# There's no PCI port I/O support on PPC/PowerPC, yet.
ifeq ($(CONFIG_NIC3COM), yes)
OpenPOWER on IntegriCloud