]> git.lizzy.rs Git - metalua.git/blob - src/config
CRLF fsckup
[metalua.git] / src / config
1 # -*-makefile-*-
2
3 #########################################################
4 # Platforms currently supported: mingw, macosx.
5 # Feel welcome to contribute additional ones! :)
6
7 PLATFORM  = macosx
8 PLATFORMS = macosx mingw linux bsd
9
10
11 #########################################################
12 # Installation paths.
13 # You might want to first build & install in a temporary
14 # directory, to check that everything works fine,
15 # before targetting /usr/local/*
16 #
17 # Beware: only absolute paths work.
18
19 TARGET_LUA_PATH  = /tmp/metalua
20 TARGET_LUA_CPATH = $(TARGET_LUA_PATH)
21 TARGET_BIN_PATH  = $(TARGET_LUA_PATH)/bin
22
23 #########################################################
24 # Lua VM settings
25 # LUA_VM_DIR is relative to the 'src' directory.
26
27 LUA_VM_DIR       = lua
28 COMPILE          = luac
29 RUN              = lua
30
31 #########################################################
32 # C compiler settings for libraries
33
34 CC               = gcc
35 CFLAGS           = -g3 -Wall -ansi -I../$(LUA_VM_DIR)
36 OBJEXT           = o
37
38 #########################################################
39 # Platform-specific settings
40
41 ifeq ($(PLATFORM), macosx)
42   LIBEXT        = so
43   MKLIB         = gcc -bundle -undefined dynamic_lookup
44   LUA_BINARIES  = $(COMPILE) $(RUN)
45   USE_READLINE  = yes
46 endif
47
48 ifeq ($(PLATFORM), mingw)
49   LIBEXT        = dll
50   MKLIB         = gcc -shared
51   LUALIB        = ../lua/lua51.dll
52   LDFLAGS       = $(LUALIB) 
53   LUA_BINARIES  = $(COMPILE).exe $(RUN).exe lua51.dll
54 endif
55
56 ifeq ($(PLATFORM), linux)
57   LIBEXT        = so
58   MKLIB         = gcc -shared
59   LDFLAGS               = -L../$(LUA_VM_DIR) -llua
60   LUA_BINARIES  = $(COMPILE) $(RUN)
61 endif
62
63 ifeq ($(PLATFORM), bsd)
64   LIBEXT        = so
65   MKLIB         = gcc -shared
66   CFLAGS       += -fPIC
67   LDFLAGS               = -fPIC
68   LUA_BINARIES  = $(COMPILE) $(RUN)
69 endif
70
71 #########################################################
72 # Environment variables settign paths
73
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)
78