3 #########################################################
4 # Platforms currently supported: mingw, macosx.
5 # Feel welcome to contribute additional ones! :)
8 PLATFORMS = macosx mingw linux bsd
11 #########################################################
13 # You might want to first build & install in a temporary
14 # directory, to check that everything works fine,
15 # before targetting /usr/local/*
17 # Beware: only absolute paths work.
19 TARGET_LUA_PATH = /tmp/metalua
20 TARGET_LUA_CPATH = $(TARGET_LUA_PATH)
21 TARGET_BIN_PATH = $(TARGET_LUA_PATH)/bin
23 #########################################################
25 # LUA_VM_DIR is relative to the 'src' directory.
31 #########################################################
32 # C compiler settings for libraries
35 CFLAGS = -g3 -Wall -ansi -I../$(LUA_VM_DIR)
38 #########################################################
39 # Platform-specific settings
41 ifeq ($(PLATFORM), macosx)
43 MKLIB = gcc -bundle -undefined dynamic_lookup
44 LUA_BINARIES = $(COMPILE) $(RUN)
48 ifeq ($(PLATFORM), mingw)
51 LUALIB = ../lua/lua51.dll
53 LUA_BINARIES = $(COMPILE).exe $(RUN).exe lua51.dll
56 ifeq ($(PLATFORM), linux)
59 LDFLAGS = -L../$(LUA_VM_DIR) -llua
60 LUA_BINARIES = $(COMPILE) $(RUN)
63 ifeq ($(PLATFORM), bsd)
68 LUA_BINARIES = $(COMPILE) $(RUN)
71 #########################################################
72 # Environment variables settign paths
74 LUA_PATH_DIRS = ./?.EXT;$(TARGET_LUA_PATH)/?.EXT
75 export LUA_PATH = $(subst EXT,luac,$(LUA_PATH_DIRS));$(subst EXT,lua,$(LUA_PATH_DIRS))
76 export LUA_MPATH = $(subst EXT,mlua,$(LUA_PATH_DIRS))
77 export LUA_CPATH = $(TARGET_LUA_CPATH)/?.$(LIBEXT);$(TARGET_LUA_CPATH)/?/linit.$(LIBEXT)