From f9c910d094a7f542f357141d8c2f3dbe8f97adca Mon Sep 17 00:00:00 2001 From: Alexander Frick Date: Thu, 4 Dec 2025 20:23:47 -0600 Subject: [PATCH] add Debug/Release build flag configs --- Makefile | 9 ++++++++- Makefile.linux | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d830fa6..5f5dd14 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,15 @@ DEFINES := -DUNICODE -D_UNICODE -D_WINDOWS -DWINVER=0x0501 -D_WIN32_WINNT=0x050 # Show all errors, compile everything static, ensure src dir is included, -municode # since this is a GUI windows app, ensure relocatable data CFLAGS := $(DEFINES) -Wall -static -static-libgcc -municode + # Compiler optimization and architecture flags -CFLAGS += -O2 -g -mfpmath=sse -mfxsr -msse -msse2 -MMD -MP +ifeq ($(BUILDTYPE), Release) +CFLAGS += -O2 -g0 -s -MMD -MP -mfpmath=sse -mfxsr -msse -msse2 +endif +ifeq ($(BUILDTYPE), Debug) +CFLAGS += -Og -g -MMD -MP -mfpmath=sse -mfxsr -msse -msse2 +endif + # C++ only flags CXXFLAGS := $(CFLAGS) -std=c++17 -static-libstdc++ diff --git a/Makefile.linux b/Makefile.linux index b5c1119..ac4db53 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -33,8 +33,15 @@ DEFINES := -DUNICODE -D_UNICODE -D_WINDOWS -DWINVER=0x0501 -D_WIN32_WINNT=0x050 # Show all errors, compile everything static, ensure src dir is included, -municode # since this is a GUI windows app, ensure relocatable data CFLAGS := $(DEFINES) -Wall -static -static-libgcc -municode + # Compiler optimization and architecture flags -CFLAGS += -O2 -g -mfpmath=sse -mfxsr -msse -msse2 -MMD -MP +ifeq ($(BUILDTYPE), Release) +CFLAGS += -O2 -g0 -s -MMD -MP -mfpmath=sse -mfxsr -msse -msse2 +endif +ifeq ($(BUILDTYPE), Debug) +CFLAGS += -Og -g -MMD -MP -mfpmath=sse -mfxsr -msse -msse2 +endif + # C++ only flags CXXFLAGS := $(CFLAGS) -std=c++17 -static-libstdc++