From 2ebc14b69c7aab2457123c831fc51286cbc62de0 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Thu, 2 Jun 2022 04:14:48 -0700 Subject: web: add debug build to Makefile --- web/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'web') diff --git a/web/Makefile b/web/Makefile index aa2666a..5fd3a24 100644 --- a/web/Makefile +++ b/web/Makefile @@ -12,6 +12,16 @@ SRC := $(wildcard *.c) ../comp.c ../match.c ../board.c ../checkouts.c all: $(TARGET) +debug: CFLAGS := $(filter-out -O3,$(CFLAGS)) \ + -fsanitize=address,undefined \ + -gsource-map \ + -sALLOW_MEMORY_GROWTH=1 \ + -sASSERTIONS=2 +comma := , +debug: CFLAGS := $(patsubst -sEXPORTED_FUNCTIONS=%,-sEXPORTED_FUNCTIONS=$\ + %$(comma)___lsan_do_recoverable_leak_check,$(CFLAGS)) +debug: $(TARGET) + $(TARGET): $(SRC) mkdir $(TARGET) $(CC) $(CFLAGS) $^ -o $(TARGET)/dartboat_wasm.js -- cgit v1.2.3-70-g09d2