libretro: add a few options for the analog combo
[pcsx_rearmed.git] / Makefile
index 642a4c6..57fee2f 100644 (file)
--- 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
@@ -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