From b97d08b127a002b6cfda0851f02ae84e3b0381b8 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Fri, 16 Jan 2026 17:47:47 +0100 Subject: Added macOS make option --- Makefile | 17 ++++++++++++++++- tdbg.cpp | 3 ++- 2 files changed, 18 insertions(+), 2 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 diff --git a/tdbg.cpp b/tdbg.cpp index 2c6e9d4..572cce9 100644 --- a/tdbg.cpp +++ b/tdbg.cpp @@ -721,9 +721,10 @@ int main(int argc, char** argv) { } } else if (ev.type == TB_EVENT_MOUSE) { int main_window_height = tb_height() - LOG_WINDOW_HEIGHT - STATUS_WINDOW_HEIGHT; + + // Log window scrolling int log_start_y = main_window_height; int log_end_y = tb_height() - STATUS_WINDOW_HEIGHT; - if (ev.y >= log_start_y && ev.y < log_end_y) { if (ev.key == TB_KEY_MOUSE_WHEEL_UP) { int max_scroll = std::max(0, (int)log_buffer.size() - (LOG_WINDOW_HEIGHT - 2)); -- cgit v1.2.3