diff options
| author | hachem <im@hachem.wtf> | 2026-09-08 01:08:54 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-08 01:08:54 +0200 |
| commit | ff0dbe69fc101d86cb4dafac7fa9d2fb6ac1a083 (patch) | |
| tree | f0f39db9c8c8bd92e5fb9991669fbcc7001ac819 /mkproj.c | |
| parent | 051fe9e5ac7369827639fc4b59fd20228b053efa (diff) | |
fix: split sanitization and debugging
Diffstat (limited to 'mkproj.c')
| -rw-r--r-- | mkproj.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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" |
