Respect C compiler set on the command line or inherited from the environment

This commit is contained in:
Zaheer Chothia 2012-05-20 18:09:35 +02:00
parent d647f751ee
commit 14c3511e92
1 changed files with 8 additions and 0 deletions

View File

@ -14,7 +14,15 @@ NETLIB_LAPACK_DIR = $(TOPDIR)/lapack-3.4.1
endif endif
# Default C compiler # Default C compiler
# - Only set if not specified on the command line or inherited from the environment.
# - CC is an implicit variable so neither '?=' or 'ifndef' can be used.
# http://stackoverflow.com/questions/4029274/mingw-and-make-variables
# - Default value is 'cc' which is not always a valid command (e.g. MinGW).
ifeq ($(origin CC),default)
CC = gcc CC = gcc
endif
# Default Fortran compiler (FC) is selected by f_check.
ifndef MAKEFILE_RULE ifndef MAKEFILE_RULE
include $(TOPDIR)/Makefile.rule include $(TOPDIR)/Makefile.rule