From 963a50d89a24e07bf3890eab51ed7c1a21bca78c Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Mon, 11 Aug 2025 12:56:06 +0200 Subject: Added macOS support --- Makefile | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'Makefile') 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=%) > $@ -- cgit v1.2.3