[Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build on
authorLang Hames <lhames@gmail.com>
Wed, 18 Feb 2015 23:08:56 +0000 (23:08 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 18 Feb 2015 23:08:56 +0000 (23:08 +0000)
Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229761 91177308-0d34-0410-b5e6-96231b3b80d8

examples/Kaleidoscope/Orc/fully_lazy/Makefile
examples/Kaleidoscope/Orc/initial/Makefile
examples/Kaleidoscope/Orc/lazy_codegen/Makefile
examples/Kaleidoscope/Orc/lazy_irgen/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:
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:
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:
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: