From 1a6f76c11fca63135bc4440d0e31c90844ffc115 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 3 May 2023 15:34:32 +0200 Subject: [PATCH] better cflags representation in makefile --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5b7ca8d..c8161b5 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,8 @@ GREP = grep AWK = awk # Déclaration des options du compilateur -CFLAGS = -Wall -O3 +COPTI = -O3 +CFLAGS = -Wall $(COPTI) -std=c17 CPPFLAGS = -I. LDFLAGS = -lm @@ -69,10 +70,10 @@ all: $(PROGNAME) $(PROGNAME): $(OBJ) $(CC) $(OBJ) $(LDFLAGS) -o $(PROGNAME) -debug: CFLAGS = -Wall -Wextra -Wconversion -Wno-sign-conversion -Wno-unused-parameter \ - -Wno-unused-function -Wdouble-promotion -Wshadow -Wcast-align \ - -Wstrict-prototypes -fanalyzer -fsanitize=undefined \ - -fsanitize-undefined-trap-on-error -g3 +debug: CFLAGS := $(filter-out $(COPTI),$(CFLAGS)) -Wextra -Wconversion -g3 -Og \ + -Wno-sign-conversion -Wno-unused-parameter -Wno-unused-function \ + -Wdouble-promotion -Wshadow -Wcast-align -Wstrict-prototypes \ + -fanalyzer -fsanitize=undefined -fsanitize-undefined-trap-on-error debug: $(PROGNAME) %.o: %.c