X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=6ded0df0064740706a0436917d1af5caba52d77c;hb=a3fcdfcb3e366264a1d9f7cfda4268eb6cd91cc0;hp=af3e1ab6099a70552ebbfca71ac568aeb83338fa;hpb=e223fa15d18a141a26d73683d036d130cc5c6e8d;p=pcsx_rearmed.git diff --git a/Makefile b/Makefile index af3e1ab6..6ded0df0 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,9 @@ CFLAGS += -Wall -ggdb -Iinclude -ffast-math ifndef DEBUG CFLAGS += -O2 -DNDEBUG endif +ifeq ($(DEBUG_ASAN), 1) +CFLAGS += -fsanitize=address +endif CFLAGS += -DP_HAVE_MMAP=$(if $(NO_MMAP),0,1) \ -DP_HAVE_PTHREAD=$(if $(NO_PTHREAD),0,1) \ -DP_HAVE_POSIX_MEMALIGN=$(if $(NO_POSIX_MEMALIGN),0,1) \ @@ -36,6 +39,9 @@ endif CC_LINK ?= $(CC) CC_AS ?= $(CC) LDFLAGS += $(MAIN_LDFLAGS) +ifeq ($(DEBUG_ASAN), 1) +LDFLAGS += -static-libasan +endif EXTRA_LDFLAGS ?= -Wl,-Map=$@.map LDLIBS += $(MAIN_LDLIBS) ifdef PCNT