From ba0018e8f97a4076b90a03b7d94e02c3eea0274c Mon Sep 17 00:00:00 2001 From: Quinn Date: Mon, 27 Jan 2025 17:09:20 +0100 Subject: [PATCH] add debug flag to compilation to allow for debug preprocessor --- makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 94473cd..d737ca0 100644 --- a/makefile +++ b/makefile @@ -8,7 +8,7 @@ CFLAGS := $(shell pkg-config --cflags sdl2) -Wall -Wextra -Wpedantic -Wno-pointe LDFLAGS := $(shell pkg-config --libs sdl2) -lm ifeq ($(DEBUG),1) -CFLAGS += -Og -g +CFLAGS += -DDEBUG -Og -g else REL_FLAGS += -O3 endif @@ -69,8 +69,12 @@ $(DIR): # update compile commands if the makefile has been updated (for linting) ifeq ($(DEBUG),1) compile_commands.json: makefile + @touch compile_commands.json + $(MAKE) clean + @echo "compiling in non-debug mode" else compile_commands.json: makefile + @echo "compiling in debug mode" @touch compile_commands.json $(MAKE) clean bear -- make