Add BUILD_TYPE option in Makefile

This commit is contained in:
Abdelrahman Said 2025-05-10 19:23:56 +01:00
parent 4963d455be
commit c3db3406bd
3 changed files with 13 additions and 6 deletions

View File

@ -1,7 +1,14 @@
CC = clang BUILD_TYPE = debug
CFLAGS = -g -Iraylib/include -Iwapp/src CC = clang
LDFLAGS = '-Wl,-rpath,$$ORIGIN/raylib/lib' -Lraylib/lib -lraylib CFLAGS = -Iraylib/include -Iwapp/src
OUT = main 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 .PHONY: all raylib game

2
build
View File

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
bear -- make bear -- make $@

2
test
View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
./build ./build $@
./main ./main