From 3aff6375a849727dfd987cbd31d331f17b5f1d27 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Thu, 15 Aug 2024 03:58:22 -0400 Subject: [PATCH] Better makefile --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8319a88..42d4ffe 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,18 @@ # Compiler and other things CC = gcc -CFLAGS = -std=c99 -Wall -Wextra -Werror -O3 -flto +CFLAGS = -std=c99 -Wall -Wextra BUILDD = build +ifdef MARCH # Allows you to define the architecture (usually not required) + CFLAGS += -march=$(MARCH) +endif +ifndef FORCE # Force the build to move past warnings (disable warnings as errors) + CFLAGS += -Werror +endif +ifdef DEBUG # Build in debug mode, usable in gdb/valgrind/etc + CFLAGS += -O2 -g +else + CFLAGS += -O3 -flto +endif HALOOLIB = haloo3d/build/haloo3d_full.a