summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2025-08-11 12:56:06 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2025-08-11 12:56:06 +0200
commit963a50d89a24e07bf3890eab51ed7c1a21bca78c (patch)
tree117d72a44d74a02bd8405ea2fa41bf58dc085092 /Makefile
parent3d8fc1a4b61485e451ebd18f3b9e8c71fe96b4cf (diff)
downloadbidi-963a50d89a24e07bf3890eab51ed7c1a21bca78c.tar.gz
Added macOS support
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 27 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 8799c5d..392a1a6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,37 @@
+OS := $(shell uname)
+ifeq ($(OS), Linux)
+SYSTEM = linux_amd64
+else ifeq ($(OS), Darwin)
+SYSTEM = macos
+else ifeq ($(OS), WindowsNT)
+SYSTEM = windows
+else
+SYSTEM = unknown
+endif
+
CC ?= tcc
-RAYLIB := raylib-5.5_linux_amd64
+# RAYLIB := raylib-5.5_linux_amd64
+RAYLIB_VER := raylib-5.5_$(SYSTEM)
LUA := lua-5.4.8
-CFLAGS := -std=c99 -v -g -I./vendor/$(RAYLIB)/include -I./vendor/$(LUA)/src
-LDFLAGS := -L./vendor/$(RAYLIB)/lib -lraylib -L./vendor/$(LUA)/src -llua -lm
+CFLAGS := -std=c99 -v -g -I./vendor/$(RAYLIB_VER)/include -I./vendor/$(LUA)/src
+LDFLAGS := -L./vendor/$(RAYLIB_VER)/lib -lraylib -L./vendor/$(LUA)/src -llua -lm
STDLIB_FILES := $(wildcard stdlib/*.lua)
FONT_FILES := $(wildcard fonts/*.ttf)
PROG := bidi
PROG_C := main.c
-all: lua hexdump $(FONT_FILES:.ttf=.h) $(STDLIB_FILES:.lua=.h) $(PROG)
+# Check if macOS and then append proper CFLAGS.
+ifeq ($(SYSTEM), macos)
+CFLAGS += -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL
+endif
+
+all: info lua hexdump $(FONT_FILES:.ttf=.h) $(STDLIB_FILES:.lua=.h) $(PROG)
+
+info: # Print out information about the build
+ $(info SYSTEM : $(SYSTEM))
+ $(info RAYLIB_VER : $(RAYLIB_VER))
+ $(info CFLAGS : $(CFLAGS))
+ $(info LDFLAGS : $(LDFLAGS))
%.h: %.lua
./hexdump $< $(@:stdlib/%.h=%) > $@