Browse Source

Apply same Linux compiler-picker logic to Mac.

Adam Ierymenko 10 years ago
parent
commit
dba91eaa09
1 changed files with 6 additions and 2 deletions
  1. 6 2
      make-mac.mk

+ 6 - 2
make-mac.mk

@@ -1,5 +1,9 @@
-CC?=clang
-CXX?=clang++
+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=-I/usr/local/include
 DEFS=