From ff0dbe69fc101d86cb4dafac7fa9d2fb6ac1a083 Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 8 Sep 2026 01:08:54 +0200 Subject: fix: split sanitization and debugging --- mkproj.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'mkproj.c') diff --git a/mkproj.c b/mkproj.c index 5a5f45d..ef2b6f9 100644 --- a/mkproj.c +++ b/mkproj.c @@ -575,7 +575,7 @@ static void write_makefile(FILE* out, const struct Config* config) if ((int) strlen(flags[i]) > width) width = (int) strlen(flags[i]); - (void) fprintf(out, "CC := %s\nSTD := %s\n\nSANITIZE ?= 1\n\nCFLAGS := ", lang->compiler, config->standard); + (void) fprintf(out, "CC := %s\nSTD := %s\n\nDEBUG ?= 1\nSANITIZE ?= 1\n\nCFLAGS := ", lang->compiler, config->standard); for (size_t i = 0; i < count; i++) { @@ -591,13 +591,17 @@ static void write_makefile(FILE* out, const struct Config* config) (void) fprintf( out, "\n" - "ifeq ($(SANITIZE),1)\n" - "CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address,undefined\n" - "LDFLAGS += -fsanitize=address,undefined\n" + "ifeq ($(DEBUG),1)\n" + "CFLAGS += -g -fno-omit-frame-pointer\n" "else\n" "CFLAGS += -O2\n" "endif\n" "\n" + "ifeq ($(SANITIZE),1)\n" + "CFLAGS += -fsanitize=address,undefined\n" + "LDFLAGS += -fsanitize=address,undefined\n" + "endif\n" + "\n" "TARGET := %s/%s\n" "SRC := $(shell find src -name '*.%s')\n" "OBJ := $(SRC:src/%%=%s/%%.o)\n" -- cgit v1.3