From 1cf7924e3f17b0daa406f77b597beb23fba7a865 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Wed, 18 Feb 2015 23:08:56 +0000 Subject: [PATCH] [Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229761 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/Kaleidoscope/Orc/fully_lazy/Makefile | 13 ++++++++++--- examples/Kaleidoscope/Orc/initial/Makefile | 13 ++++++++++--- examples/Kaleidoscope/Orc/lazy_codegen/Makefile | 13 ++++++++++--- examples/Kaleidoscope/Orc/lazy_irgen/Makefile | 13 ++++++++++--- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/examples/Kaleidoscope/Orc/fully_lazy/Makefile b/examples/Kaleidoscope/Orc/fully_lazy/Makefile index df0fcb35066..e14cce2ba36 100644 --- a/examples/Kaleidoscope/Orc/fully_lazy/Makefile +++ b/examples/Kaleidoscope/Orc/fully_lazy/Makefile @@ -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: diff --git a/examples/Kaleidoscope/Orc/initial/Makefile b/examples/Kaleidoscope/Orc/initial/Makefile index df0fcb35066..e14cce2ba36 100644 --- a/examples/Kaleidoscope/Orc/initial/Makefile +++ b/examples/Kaleidoscope/Orc/initial/Makefile @@ -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: diff --git a/examples/Kaleidoscope/Orc/lazy_codegen/Makefile b/examples/Kaleidoscope/Orc/lazy_codegen/Makefile index df0fcb35066..e14cce2ba36 100644 --- a/examples/Kaleidoscope/Orc/lazy_codegen/Makefile +++ b/examples/Kaleidoscope/Orc/lazy_codegen/Makefile @@ -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: diff --git a/examples/Kaleidoscope/Orc/lazy_irgen/Makefile b/examples/Kaleidoscope/Orc/lazy_irgen/Makefile index df0fcb35066..e14cce2ba36 100644 --- a/examples/Kaleidoscope/Orc/lazy_irgen/Makefile +++ b/examples/Kaleidoscope/Orc/lazy_irgen/Makefile @@ -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: -- 2.34.1