diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-23 13:05:18 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-23 13:05:18 -0700 |
commit | a493fc23f4305f80d93f0879324aa87f536a1a90 (patch) | |
tree | af87a26f1454b53a2c1810c766fb44a85f5c61f8 | |
parent | b3516c599bb0beb4b4827f28da472972344379c6 (diff) | |
download | infinitytier-a493fc23f4305f80d93f0879324aa87f536a1a90.tar.gz infinitytier-a493fc23f4305f80d93f0879324aa87f536a1a90.zip |
Fix for make-linux: detect whether CC/CXX were explicitly overridden, and if not then use the gcc/clang selection logic. Otherwise ?= breaks this.
-rw-r--r-- | make-linux.mk | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/make-linux.mk b/make-linux.mk index c56f3569..d1e0c955 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -18,8 +18,14 @@ # # Automagically pick clang or gcc, with preference for clang -CC?=$(shell if [ -e /usr/bin/clang ]; then echo clang; else echo gcc; fi) -CXX?=$(shell if [ -e /usr/bin/clang++ ]; then echo clang++; else echo g++; fi) +# This is only done if we have not overridden these with an environment or CLI variable +ifeq ($(origin CC),default) + CC=$(shell if [ -e /usr/bin/clang ]; then echo clang; else echo gcc; fi) +endif +ifeq ($(origin CXX),default) + CXX=$(shell if [ -e /usr/bin/clang++ ]; then echo clang++; else echo g++; fi) +endif + INCLUDES= DEFS= LDLIBS?= |