X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=57fee2fc2623c8af7e17dd21c073aa4f4abc590a;hb=4ec65cf9e9d59e5edc5e86a58000e14060fe6b18;hp=864565e5fbdaf0e81aa93a39d2b07523210a7680;hpb=c6a249e3b48161bcf6d8ab3eb0538d96edd67797;p=pcsx_rearmed.git diff --git a/Makefile b/Makefile index 864565e5..57fee2fc 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,9 @@ else CFLAGS += -O2 -DNDEBUG endif 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) \ @@ -45,6 +48,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 @@ -411,7 +417,7 @@ $(TARGET): $(OBJS) ifeq ($(STATIC_LINKING), 1) $(AR) rcs $@ $(OBJS) else - $(CC_LINK) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(EXTRA_LDFLAGS) + $(CC_LINK) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(EXTRA_LDFLAGS) endif clean: $(PLAT_CLEAN) clean_plugins @@ -421,10 +427,10 @@ ifneq ($(PLUGINS),) plugins_: $(PLUGINS) $(PLUGINS): - make -C $(dir $@) + $(MAKE) -C $(dir $@) clean_plugins: - make -C plugins/gpulib/ clean + $(MAKE) -C plugins/gpulib/ clean for dir in $(PLUGINS) ; do \ $(MAKE) -C $$(dirname $$dir) clean; done else