Skip to content

Commit c160d8c

Browse files
committed
Add "make asan" target
1 parent 51695e9 commit c160d8c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SRC_TARGETS=all clean install user-install uninstall user-uninstall
1+
SRC_TARGETS=all clean install user-install uninstall user-uninstall asan
22

33
$(SRC_TARGETS): src/Makefile
44
$(MAKE) -C src $@

src/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CC?= gcc
22
TARGET = r2mcp
33
CFLAGS = -Wall -Wextra -g
4+
5+
# AddressSanitizer build
6+
asan: CFLAGS += -fsanitize=address -fsanitize=undefined -g3 -O1
7+
asan: LDFLAGS += -fsanitize=address -fsanitize=undefined
8+
asan: clean $(TARGET)
9+
@echo "✓ AddressSanitizer build complete."
410
PKGCONFIG = pkg-config
511
INSTALL_DIR?=install -d
612
R2_LIBEXT=$(shell r2 -H R2_LIBEXT)
@@ -91,6 +97,7 @@ indent fmt:
9197
help:
9298
@echo "Available targets:"
9399
@echo " all - Build the server (default)"
100+
@echo " asan - Build with AddressSanitizer (ASAN)"
94101
@echo " check_deps - Check for required dependencies"
95102
@echo " clean - Remove built binaries"
96103
@echo " install - Install the server to /usr/local/bin"

0 commit comments

Comments
 (0)