From 341e606f93668b04a3c7691856329ac73ed4a2a0 Mon Sep 17 00:00:00 2001 From: unset Date: Sun, 26 Jan 2025 11:46:42 +0100 Subject: [PATCH] allow to add debug parameter --- .vscode/tasks.json | 5 +++++ makefile | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e46ad28..0fd34b4 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,5 +1,10 @@ { "version": "2.0.0", + "options": { + "env": { + "DEBUG": "1" + } + }, "tasks": [ { "type": "shell", diff --git a/makefile b/makefile index 851069d..cddac66 100644 --- a/makefile +++ b/makefile @@ -4,9 +4,15 @@ NAME = breakout_clone CC := clang STD := c17 LANG = c -CFLAGS := $(shell pkg-config --cflags sdl2) -O3 -g -Wall -Wall -Wextra -Wpedantic -Wno-pointer-arith +CFLAGS := $(shell pkg-config --cflags sdl2) -Wall -Wall -Wextra -Wpedantic -Wno-pointer-arith LDFLAGS := $(shell pkg-config --libs sdl2) -lm +ifeq ($(DEBUG),1) +CFLAGS += -Og -g +else +REL_FLAGS += -O3 +endif + # dirs DIR_BIN := bin DIR_OBJ := obj