From d3b39be57c817a942866a891985d211262ea15f7 Mon Sep 17 00:00:00 2001 From: Alessandre Laguierce Date: Fri, 21 Mar 2025 08:43:16 +0100 Subject: [PATCH] feat: keep compiler optimizations and remove debug symbols when not in debug mode --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b4f38d5..2bb6f59 100644 --- a/Makefile +++ b/Makefile @@ -32,14 +32,16 @@ check_targets=$(addprefix check_,${bins}) src_dirs=$(sort $(dir $(wildcard ${src_dir}/**/))) includes=$(patsubst %,-I%,${src_dirs}) -CFLAGS+=-g -O0 ${includes} -fPIC +CFLAGS+=${includes} -fPIC LDFLAGS+= ifdef USE_PTHREAD LDFLAGS+=-lpthread CFLAGS+=-DUSE_PTHREAD endif ifndef USE_DEBUG -CFLAGS+=-DNDEBUG -DNTRACE +CFLAGS+=-g -O0 -DNDEBUG -DNTRACE +else +CFLAGS+=-03 endif # Tests if the last compilation was with pthread