summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-01-16 17:47:47 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-01-16 17:47:47 +0100
commitb97d08b127a002b6cfda0851f02ae84e3b0381b8 (patch)
treed1e0dd931db1a9ff7c4dff96bad999d3b41d9f15 /Makefile
parentff0037ae54eccb71672f2abb88e60e2467cacf65 (diff)
downloadtoy-debugger-b97d08b127a002b6cfda0851f02ae84e3b0381b8.tar.gz
Added macOS make option
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b6264b0..12f9c1f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,22 @@
+UNAME_S := $(shell uname -s)
+
+ifeq ($(UNAME_S),Linux)
+ LLVM_PREFIX := /usr/lib/llvm/21
+endif
+ifeq ($(UNAME_S),Darwin)
+ LLVM_PREFIX := /System/Volumes/Data/opt/homebrew/Cellar/llvm/21.1.8
+endif
+
+CXXFLAGS := -I$(LLVM_PREFIX)/include -std=c++17
+LDFLAGS := -L$(LLVM_PREFIX)/lib -Wl,-rpath,$(LLVM_PREFIX)/lib -llldb
+
all: tdbg example
tdbg: tdbg.cpp
- clang++ tdbg.cpp -o tdbg -I/usr/lib/llvm/21/include -L/usr/lib/llvm/21/lib -Wl,-rpath,/usr/lib/llvm/21/lib -llldb -std=c++17
+ clang++ tdbg.cpp -o tdbg $(CXXFLAGS) $(LDFLAGS)
example: example.c
clang -g -o example example.c
+
+clean:
+ rm -f tdbg example