From 142bb376091c8a9c0ed5af34bbc6c57ffab1bd7f Mon Sep 17 00:00:00 2001
From: Florian Schmaus <flow@cs.fau.de>
Date: Sat, 15 Jan 2022 18:45:13 +0100
Subject: [PATCH] Intermediate Commit (2022-01-15 18:45)

---
 Makefile | 35 +++++++++++------------------------
 1 file changed, 11 insertions(+), 24 deletions(-)

diff --git a/Makefile b/Makefile
index b63337ee..07ee51e9 100644
--- a/Makefile
+++ b/Makefile
@@ -35,33 +35,20 @@ debug:
 	$(MAKE) build BUILDTYPE=$@
 
 define sanitizer
-.PHONY: sanitizer-$1
-sanitizer-$1: export CC = clang
-sanitizer-$1: export CXX = clang++
-sanitizer-$1:
-	rm -f build
-	$(MAKE) build BUILDTYPE=debug BUILDDIR=$@ \
-		EMPER_B_SANITIZE=$1 EMPER_B_LUNDEF=false
+rm -rf build
+$(MAKE) build \
+	BUILDDIR=build-$@ \
+	CC=clang CXX=clang++ \
+	EMPER_B_SANITIZE=$(subst sanitize-,,$@) EMPER_B_LUNDEF=false
 endef
 
-$(sanitizer) memory
-$(sanitizer) address
-
-.PHONY: debug-msan
-debug-msan: export CC = clang
-debug-msan: export CXX = clang++
-debug-msan:
-	rm -f build
-	$(MAKE) build BUILDTYPE=debug BUILDDIR=$@ \
-		EMPER_B_SANITIZE=memory EMPER_B_LUNDEF=false
+PHONY: sanitize-memory
+sanitize-memory:
+	$(sanitizer)
 
-.PHONY: debug-asan
-debug-asan: export CC = clang
-debug-asan: export CXX = clang++
-debug-asan:
-	rm -f build
-	$(MAKE) build BUILDTYPE=debug BUILDDIR=$@ \
-		EMPER_B_SANITIZE=address EMPER_B_LUNDEF=false
+PHONY: sanitize-address
+sanitize-address:
+	$(sanitizer)
 
 .PHONY: fast-static-analysis
 fast-static-analysis: all check-format check-license doc
-- 
GitLab