Changeset 1418 for trunk


Ignore:
Timestamp:
08/20/11 16:16:00 (9 months ago)
Author:
uwe
Message:

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

Signed-off-by: Uwe Hermann <uwe@…>
Acked-by: Stefan Tauner <stefan.tauner@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r1416 r1418  
    3838endif 
    3939 
    40 # Determine the destination processor architecture 
    41 override ARCH := $(strip $(shell LC_ALL=C $(CC) -E arch.h|grep -v '^\#')) 
    42  
    4340# FIXME We have to differentiate between host and target OS architecture. 
    4441OS_ARCH ?= $(shell uname) 
     
    202199endif 
    203200endif 
     201 
     202# Determine the destination processor architecture. 
     203# IMPORTANT: The following line must be placed before ARCH is ever used 
     204# (of course), but should come after any lines setting CC because the line 
     205# below uses CC itself. In some cases we set CC based on OS_ARCH, see above. 
     206override ARCH := $(strip $(shell LC_ALL=C $(CC) -E arch.h 2>/dev/null | grep -v '^\#')) 
    204207 
    205208ifeq ($(ARCH), "ppc") 
Note: See TracChangeset for help on using the changeset viewer.