From 693cab7a3444c90e50214187677a7d43866315a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LUDWIG?= Date: Sat, 5 Aug 2023 15:33:19 +0200 Subject: [PATCH] chore: only use sanitizer flags in test --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0cea472..9d8d127 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ LIBRARY_NAME = libcproject CC = gcc -CC_FLAGS = -Wall -Wextra -Wfloat-equal -Wundef -Werror -std=c17 -pedantic -pedantic-errors -O3 -fsanitize=address -fsanitize=undefined -I./ +CC_FLAGS = -Wall -Wextra -Wfloat-equal -Wundef -Werror -std=c17 -pedantic -pedantic-errors -O3 -I./ +CC_SANITIZER_FLAGS = -fsanitize=address -fsanitize=undefined LIB = ./build/${LIBRARY_NAME}.a LIB_CC_FLAGS = -L. -l:${LIB} LIB_SOURCES = $(wildcard lib/*.c) @@ -42,7 +43,7 @@ set_version: ${LIB} ./set_version.c .PHONY: test test: ${LIB} $(addprefix build/, ${TEST_OBJECTS}) mkdir --parents ./bin - ${CC} ${CC_FLAGS} -o ${TEST_EXECUTABLE} $(addprefix build/, ${TEST_OBJECTS}) ${LIB_CC_FLAGS} + ${CC} ${CC_FLAGS} ${CC_SANITIZER_FLAGS} -o ${TEST_EXECUTABLE} $(addprefix build/, ${TEST_OBJECTS}) ${LIB_CC_FLAGS} ./${TEST_EXECUTABLE} ${ARGS} .PHONY: lint