diff options
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=%) > $@ |
