aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/2022-07-07-llvm-orc-jit/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'content/2022-07-07-llvm-orc-jit/Makefile')
-rw-r--r--content/2022-07-07-llvm-orc-jit/Makefile30
1 files changed, 11 insertions, 19 deletions
diff --git a/content/2022-07-07-llvm-orc-jit/Makefile b/content/2022-07-07-llvm-orc-jit/Makefile
index d292bf1..793d9db 100644
--- a/content/2022-07-07-llvm-orc-jit/Makefile
+++ b/content/2022-07-07-llvm-orc-jit/Makefile
@@ -1,27 +1,19 @@
-LIBS = $(shell llvm-config --libs)
-LIBS += -lclang-cpp
-
-CXXFLAGS = -Wall -Wextra -Werror
-CXXFLAGS += -O0
-CXXFLAGS += -g
-CXXFLAGS += -std=c++17
-
-SAN ?= 1
-ifeq ($(SAN),1)
-FLAGS = -fsanitize=address -fsanitize=leak -fsanitize=undefined
-endif
-
-run: main
+run: BUILD/main
./$^
-main: main.o
- $(CXX) -o $@ $^ $(LIBS) $(FLAGS)
+BUILD/main: BUILD/CMakeCache.txt main.cc jit.h ccompiler.h
+ ninja -C BUILD
-%.o: %.cc
- $(CXX) -o $@ -c $^ $(CXXFLAGS) $(FLAGS)
+BUILD/CMakeCache.txt: CMakeLists.txt
+ # When building against a specific LLVM/CLANG build use
+ # -DCLANG_INSTALL_PREFIX=<PATH>
+ # to configure the root of the installation.
+ cmake -B BUILD -S . -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=1
+ ln -sfn BUILD/compile_commands.json
+ touch $@
fmt:
clang-format -i *.cc *.h
clean:
- $(RM) main *.o
+ $(RM) -r BUILD compile_commands.json