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 /Makefile | |
| parent | 051fe9e5ac7369827639fc4b59fd20228b053efa (diff) | |
fix: split sanitization and debugging
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,6 +1,7 @@ CC := clang STD := c17 +DEBUG ?= 1 SANITIZE ?= 1 CFLAGS := -std=$(STD) \ @@ -13,13 +14,17 @@ CFLAGS := -std=$(STD) \ -Wsign-conversion \ -Wmissing-prototypes -ifeq ($(SANITIZE),1) -CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address,undefined -LDFLAGS += -fsanitize=address,undefined +ifeq ($(DEBUG),1) +CFLAGS += -g -fno-omit-frame-pointer else CFLAGS += -O2 endif +ifeq ($(SANITIZE),1) +CFLAGS += -fsanitize=address,undefined +LDFLAGS += -fsanitize=address,undefined +endif + TARGET := mkproj SRC := mkproj.c @@ -39,10 +44,10 @@ check: --error-exitcode=1 clean: - rm -f $(TARGET) + rm -rf $(TARGET) $(TARGET).dSYM install: mkproj.1 - $(MAKE) SANITIZE=0 clean all + $(MAKE) DEBUG=0 SANITIZE=0 clean all install -d $(bindir) install -m 755 $(TARGET) $(bindir)/$(TARGET) install -d $(mandir) |
