aboutsummaryrefslogtreecommitdiffstats
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/makefile b/makefile
index faad780..a43759e 100644
--- a/makefile
+++ b/makefile
@@ -1,8 +1,9 @@
-# Header in which assert(x) is defined
CM_OPT_RELEASE ?= 0
CM_OPT_CC_FLAGS ?=
CM_OPT_ASSERT_PATH ?= <assert.h>
CM_OPT_ENABLE_DEMO ?= 1
+CM_OPT_ENABLE_UBSAN ?= 0
+CM_OPT_ENABLE_ASAN ?= 0
CC ?= gcc
@@ -29,6 +30,14 @@ endif
CM_CC_FLAGS += $(CM_OPT_CC_FLAGS)
CM_CC_FLAGS += -DCM_OPT_ASSERT_PATH='$(CM_OPT_ASSERT_PATH)'
+ifeq ($(CM_OPT_ENABLE_UBSAN),1)
+ CM_CC_FLAGS += -fsanitize=undefined
+endif
+
+ifeq ($(CM_OPT_ENABLE_ASAN),1)
+ CM_CC_FLAGS += -fsanitize=address
+endif
+
.PHONY: all
all:: $(CM_OBJECT)