[Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build on
[oota-llvm.git] / examples / Kaleidoscope / Orc / fully_lazy / Makefile
index df0fcb35066575e1e3e460f8f4f350244cb220b4..e14cce2ba36af3cbddce42621f0a3e858ecb509c 100644 (file)
@@ -1,8 +1,15 @@
-.PHONY: all
-all: toy
+UNAME := $(shell uname -s)
+
+ifeq ($(UNAME),Darwin)
+       CXX := xcrun --sdk macosx clang++
+else
+       CXX := clang++
+endif
+
+LLVM_CXXFLAGS := $(shell llvm-config --cppflags --ldflags --system-libs --libs core orcjit native)
 
 toy: toy.cpp
-       clang++ -Wall -std=c++11 toy.cpp -g -O0 -rdynamic -fno-rtti `llvm-config --cppflags --ldflags --system-libs --libs core orcjit native` -o toy
+       $(CXX) $(LLVM_CXXFLAGS) -Wall -std=c++14 -g -O0 -rdynamic -fno-rtti -o toy toy.cpp
 
 .PHONY: clean
 clean: