diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2025-08-11 12:56:06 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2025-08-11 12:56:06 +0200 |
| commit | 963a50d89a24e07bf3890eab51ed7c1a21bca78c (patch) | |
| tree | 117d72a44d74a02bd8405ea2fa41bf58dc085092 /Makefile | |
| parent | 3d8fc1a4b61485e451ebd18f3b9e8c71fe96b4cf (diff) | |
| download | bidi-963a50d89a24e07bf3890eab51ed7c1a21bca78c.tar.gz | |
Added macOS support
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 31 |
1 files changed, 27 insertions, 4 deletions
@@ -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=%) > $@ |
