mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 05:55:46 +01:00
add debug flag to compilation to allow for debug preprocessor
This commit is contained in:
6
makefile
6
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
|
||||
|
||||
Reference in New Issue
Block a user