From c3db3406bd6f2cc6b6c146b21f4bbf5590c8df6e Mon Sep 17 00:00:00 2001 From: Abdelrahman Said Date: Sat, 10 May 2025 19:23:56 +0100 Subject: [PATCH] Add BUILD_TYPE option in Makefile --- Makefile | 15 +++++++++++---- build | 2 +- test | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index dde0dfb..52e0d16 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,14 @@ -CC = clang -CFLAGS = -g -Iraylib/include -Iwapp/src -LDFLAGS = '-Wl,-rpath,$$ORIGIN/raylib/lib' -Lraylib/lib -lraylib -OUT = main +BUILD_TYPE = debug +CC = clang +CFLAGS = -Iraylib/include -Iwapp/src +LDFLAGS = '-Wl,-rpath,$$ORIGIN/raylib/lib' -Lraylib/lib -lraylib +OUT = main + +ifeq ($(BUILD_TYPE),debug) + CFLAGS += -g +else + CFLAGS += -O2 +endif .PHONY: all raylib game diff --git a/build b/build index e482bec..97a3f7e 100755 --- a/build +++ b/build @@ -1,3 +1,3 @@ #!/bin/bash -bear -- make +bear -- make $@ diff --git a/test b/test index 66ee3b7..b26d3fd 100755 --- a/test +++ b/test @@ -1,4 +1,4 @@ #!/bin/bash -./build +./build $@ ./main