From cd9ee68c85f1b6488743457b04c3c0b408da11af Mon Sep 17 00:00:00 2001 From: Quinn Date: Sun, 26 Jan 2025 11:50:32 +0100 Subject: [PATCH] sync makefile with template to add more advanced debugging options --- .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 055cf0d..a84ce23 100644 --- a/makefile +++ b/makefile @@ -4,9 +4,15 @@ NAME = sdl_template CC := clang STD := c17 LANG = c -CFLAGS := $(shell pkg-config --cflags sdl2) -Wall -g -pedantic +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 + # file locations DIR_BIN := bin DIR_OBJ := obj