Compile with cc rather than gcc whenever possible
This commit is contained in:
parent
d636b418af
commit
36a17536ca
|
@ -17,16 +17,20 @@ NETLIB_LAPACK_DIR = $(TOPDIR)/lapack-netlib
|
||||||
# http://stackoverflow.com/questions/4029274/mingw-and-make-variables
|
# http://stackoverflow.com/questions/4029274/mingw-and-make-variables
|
||||||
# - Default value is 'cc' which is not always a valid command (e.g. MinGW).
|
# - Default value is 'cc' which is not always a valid command (e.g. MinGW).
|
||||||
ifeq ($(origin CC),default)
|
ifeq ($(origin CC),default)
|
||||||
|
|
||||||
|
# Check if $(CC) refers to a valid command and set the value to gcc if not
|
||||||
|
ifneq ($(findstring cmd.exe,$(SHELL)),)
|
||||||
|
ifeq ($(shell where $(CC) 2>NUL),)
|
||||||
|
CC = gcc
|
||||||
|
endif
|
||||||
|
else # POSIX
|
||||||
|
ifeq ($(shell command -v $(CC) 2>/dev/null),)
|
||||||
CC = gcc
|
CC = gcc
|
||||||
# Change the default compile to clang on Mac OSX.
|
|
||||||
# http://stackoverflow.com/questions/714100/os-detecting-makefile
|
|
||||||
UNAME_S := $(shell uname -s)
|
|
||||||
ifeq ($(UNAME_S),Darwin)
|
|
||||||
CC = clang
|
|
||||||
# EXTRALIB += -Wl,-no_compact_unwind
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
endif # CC is set to default
|
||||||
|
|
||||||
# Default Fortran compiler (FC) is selected by f_check.
|
# Default Fortran compiler (FC) is selected by f_check.
|
||||||
|
|
||||||
ifndef MAKEFILE_RULE
|
ifndef MAKEFILE_RULE
|
||||||
|
|
Loading…
Reference in New Issue