summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2024-03-07 21:56:36 +0100
committerAlbert Cervin <albert@acervin.com>2024-03-07 21:56:36 +0100
commitcd87d88a930a0b58cfca38678d2e757491c17b26 (patch)
tree412352d2ae67b6e64df6320d64a3cfeda0194b88 /Makefile
parenta13750209b3836a4a6a16a7ba881625f397f160f (diff)
downloaddged-cd87d88a930a0b58cfca38678d2e757491c17b26.tar.gz
dged-cd87d88a930a0b58cfca38678d2e757491c17b26.tar.xz
dged-cd87d88a930a0b58cfca38678d2e757491c17b26.zip
Fix asan errors
It found some really nasty ones :)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index d469509..43b2be9 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,13 @@ datadir = $(prefix)/share/dged
CFLAGS += -Werror -g -O2 -std=c99 -I $(.CURDIR)/src -I $(.CURDIR)/src/main -DDATADIR="$(datadir)"
+ASAN ?= false
+
+.if $(ASAN:tl) == true
+CFLAGS += -fsanitize=address -fno-omit-frame-pointer
+LDFLAGS += -fsanitize=address
+.endif
+
.if $(SYNTAX_ENABLE:tl) == true
HEADERS += src/dged/syntax.h
SOURCES += src/dged/syntax.c
@@ -73,7 +80,7 @@ FILES = $(DEPS) $(MAIN_OBJS) $(OBJS) dged libdged.a $(TEST_OBJS) $(PLATFORM_OBJS
grammars:
if [ -n "$$TREESITTER_GRAMMARS" ]; then \
IFS=":"; for p in "$$TREESITTER_GRAMMARS"; do \
- cp -rL "$$p"/ grammars; \
+ cp -rL --no-preserve=mode "$$p"/ grammars; \
done \
else \
@echo "TODO: download and build default set of grammars"; \