summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-04-28 07:50:31 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-04-28 09:23:47 +0200
commit63eb46698b1e19d3f36944992b948c54a7a3740b (patch)
tree1aa8b686039e2f9291d680c21a47427de5daa12b /Makefile
parent0ed91795a2db720e688fd2daefd22f7e9c754c2f (diff)
downloadstalag-63eb46698b1e19d3f36944992b948c54a7a3740b.tar.gz
Compiler settings and macOS port
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 13 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 150f3b5..67decc8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,31 +1,34 @@
OS := $(shell uname)
ifeq ($(OS), Linux)
-SYSTEM = linux_amd64
+ SYSTEM = linux_amd64
else ifeq ($(OS), Darwin)
-SYSTEM = macos
+ SYSTEM = macos
else ifeq ($(OS), WindowsNT)
-SYSTEM = windows
+ SYSTEM = windows
else
-SYSTEM = unknown
+ SYSTEM = unknown
endif
CC := clang
RAYLIB_VER := raylib-6.0_$(SYSTEM)
CFLAGS := -std=c99 -v -g -I./vendor/$(RAYLIB_VER)/include
-LDFLAGS := -L./vendor/$(RAYLIB_VER)/lib -Wl,-Bstatic -lraylib -Wl,-Bdynamic -lm -lpthread -ldl -lrt -lX11
+LDFLAGS := ./vendor/$(RAYLIB_VER)/lib/libraylib.a -lm
GAME := bin/stalag
HEXDUMP := bin/hexdump
-SOURCES := main.c
+SOURCES := main.c map.c game.c
+
+ifeq ($(SYSTEM), linux_amd64)
+ LDFLAGS += -lX11
+endif
-# Check if macOS and then append proper CFLAGS.
ifeq ($(SYSTEM), macos)
-CFLAGS += -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL
+ LDFLAGS += -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL
endif
all: info mkdirs $(HEXDUMP) $(GAME)
.PHONY: info mkdirs clean
-
+
info: # Print out information about the build
$(info CC : $(CC))
$(info SYSTEM : $(SYSTEM))
@@ -43,4 +46,4 @@ mkdirs:
mkdir -p bin
clean:
- -rm $(GAME) $(HEXDUMP) \ No newline at end of file
+ -rm $(GAME) $(HEXDUMP)