From 14c3511e9271b06d57a7a3777dbe16b3717a48b7 Mon Sep 17 00:00:00 2001 From: Zaheer Chothia Date: Sun, 20 May 2012 18:09:35 +0200 Subject: [PATCH] Respect C compiler set on the command line or inherited from the environment --- Makefile.system | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile.system b/Makefile.system index c9e74faa6..c72326ed5 100644 --- a/Makefile.system +++ b/Makefile.system @@ -14,7 +14,15 @@ NETLIB_LAPACK_DIR = $(TOPDIR)/lapack-3.4.1 endif # 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 +endif + +# Default Fortran compiler (FC) is selected by f_check. ifndef MAKEFILE_RULE include $(TOPDIR)/Makefile.rule