From 90616b0d5f403c7eb60d63de8f20c3a4f320c138 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Sat, 29 Apr 2023 21:05:45 +0000 Subject: [PATCH] Improve debug compilation options --- .make-and-exec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.make-and-exec b/.make-and-exec index 1993d30..0711f15 100755 --- a/.make-and-exec +++ b/.make-and-exec @@ -4,7 +4,7 @@ # Making a symlink named foo-dbg causes it to compile foo.c with -DDEBUG. # To customise the compilation, you can set a CFLAGS env var before running foo. sourcename="${0%-dbg}.c" -if [[ "$0" == *-dbg ]]; then opt='-O0 -DDEBUG'; else opt='-O3'; fi +if [[ "$0" == *-dbg ]]; then opt='-Og -fsanitize=undefined,address -DDEBUG'; else opt='-O3'; fi targetfile="$(dirname "$0")/.make-and-exec-binaries/$(basename "$0")" if [[ ! -f "${targetfile}" || "${sourcename}" -nt "${targetfile}" ]]; then mkdir -p "$(dirname "$0")/.make-and-exec-binaries"