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) \
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
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
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