From 9f9e110dbd294521f5cc9b765b00276068f71f35 Mon Sep 17 00:00:00 2001 From: Quinn Date: Sun, 26 Jan 2025 11:45:53 +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 2331e1c..2833583 100644 --- a/makefile +++ b/makefile @@ -4,9 +4,15 @@ NAME = sdl_template 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