From 629a1b62f1c41cb9533a6977e63402a55e601d23 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 23 Mar 2020 14:52:01 -0400 Subject: Makefile: Add asan, msan, ubsan targets --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3ca53af..bf44cdb 100644 --- a/Makefile +++ b/Makefile @@ -100,6 +100,15 @@ bfs: \ util.o $(CC) $(ALL_LDFLAGS) $^ $(ALL_LDLIBS) -o $@ +asan: LOCAL_CFLAGS += $(ASAN_CFLAGS) +asan: bfs + +ubsan: LOCAL_CFLAGS += $(UBSAN_CFLAGS) +ubsan: bfs + +msan: LOCAL_CFLAGS += $(MSAN_CFLAGS) +msan: bfs + release: CFLAGS := -g $(WFLAGS) -O3 -flto -DNDEBUG release: bfs @@ -115,10 +124,10 @@ check-%: all ./tests.sh --bfs="$(CURDIR)/bfs -S $*" $(TEST_FLAGS) distcheck: - +$(MAKE) -Bs check CFLAGS="$(CFLAGS) $(ASAN_CFLAGS) $(UBSAN_CFLAGS)" $(DISTCHECK_FLAGS) + +$(MAKE) -Bs asan ubsan check $(DISTCHECK_FLAGS) ifneq ($(OS),Darwin) - +$(MAKE) -Bs check CC=clang CFLAGS="$(CFLAGS) $(MSAN_CFLAGS)" $(DISTCHECK_FLAGS) - +$(MAKE) -Bs check CFLAGS="$(CFLAGS) -m32" $(DISTCHECK_FLAGS) + +$(MAKE) -Bs msan check CC=clang $(DISTCHECK_FLAGS) + +$(MAKE) -Bs check CFLAGS="-m32" $(DISTCHECK_FLAGS) endif +$(MAKE) -Bs release check $(DISTCHECK_FLAGS) +$(MAKE) -Bs check $(DISTCHECK_FLAGS) -- cgit v1.2.3