# HG changeset patch # User Matti Hamalainen # Date 1599778775 -10800 # Node ID ab53c76f40d5103f3d5f5560f35b12f482e94e3d # Parent 5a1c5af0ced1f9a40b2a91ee0ac22e8c6f381e94 Add Makefile parameter ASAN to enable address sanitizer build (and disable -O and -flto when doing that.) diff -r 5a1c5af0ced1 -r ab53c76f40d5 Makefile.gen --- a/Makefile.gen Wed Aug 26 10:11:14 2020 +0300 +++ b/Makefile.gen Fri Sep 11 01:59:35 2020 +0300 @@ -1,10 +1,15 @@ CFLAGS += -W -Wall -Wextra -std=c99 -pedantic -I./ -D_XOPEN_SOURCE=500 CFLAGS += -g -CFLAGS += -O2 -#CFLAGS += -flto CFLAGS += -DTH_USE_OPT_ARG=1 THLIBS = th-libs/ +ifneq ($(ASAN),) +CFLAGS += -fsanitize=address +LDFLAGS += -lasan +else +CFLAGS += -O2 +CFLAGS += -flto +endif ### ### Objects and targets