Tamar 0.7.5 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitmodules +3 -0
- data/HISTORY +22 -5
- data/Tamar.gemspec +114 -1
- data/VERSION +1 -1
- data/src/lua/CMakeLists.txt +176 -0
- data/src/lua/COPYRIGHT +34 -0
- data/src/lua/FindReadline.cmake +25 -0
- data/src/lua/HISTORY +183 -0
- data/src/lua/INSTALL +99 -0
- data/src/lua/Makefile +128 -0
- data/src/lua/README +46 -0
- data/src/lua/dist.cmake +450 -0
- data/src/lua/dist.info +10 -0
- data/src/lua/doc/amazon.gif +0 -0
- data/src/lua/doc/contents.html +499 -0
- data/src/lua/doc/cover.png +0 -0
- data/src/lua/doc/logo.gif +0 -0
- data/src/lua/doc/lua.1 +163 -0
- data/src/lua/doc/lua.css +41 -0
- data/src/lua/doc/lua.html +172 -0
- data/src/lua/doc/luac.1 +136 -0
- data/src/lua/doc/luac.html +145 -0
- data/src/lua/doc/manual.css +13 -0
- data/src/lua/doc/manual.html +8801 -0
- data/src/lua/doc/readme.html +40 -0
- data/src/lua/etc/Makefile +44 -0
- data/src/lua/etc/README +37 -0
- data/src/lua/etc/all.c +38 -0
- data/src/lua/etc/lua.hpp +9 -0
- data/src/lua/etc/lua.ico +0 -0
- data/src/lua/etc/lua.pc +31 -0
- data/src/lua/etc/luavs.bat +28 -0
- data/src/lua/etc/min.c +39 -0
- data/src/lua/etc/noparser.c +50 -0
- data/src/lua/etc/strict.lua +41 -0
- data/src/lua/src/Makefile +182 -0
- data/src/lua/src/lapi.c +1087 -0
- data/src/lua/src/lapi.h +16 -0
- data/src/lua/src/lauxlib.c +652 -0
- data/src/lua/src/lauxlib.h +174 -0
- data/src/lua/src/lbaselib.c +653 -0
- data/src/lua/src/lcode.c +831 -0
- data/src/lua/src/lcode.h +76 -0
- data/src/lua/src/ldblib.c +398 -0
- data/src/lua/src/ldebug.c +638 -0
- data/src/lua/src/ldebug.h +33 -0
- data/src/lua/src/ldo.c +518 -0
- data/src/lua/src/ldo.h +57 -0
- data/src/lua/src/ldump.c +164 -0
- data/src/lua/src/lfunc.c +174 -0
- data/src/lua/src/lfunc.h +34 -0
- data/src/lua/src/lgc.c +711 -0
- data/src/lua/src/lgc.h +110 -0
- data/src/lua/src/linit.c +38 -0
- data/src/lua/src/liolib.c +556 -0
- data/src/lua/src/llex.c +463 -0
- data/src/lua/src/llex.h +81 -0
- data/src/lua/src/llimits.h +128 -0
- data/src/lua/src/lmathlib.c +263 -0
- data/src/lua/src/lmem.c +86 -0
- data/src/lua/src/lmem.h +49 -0
- data/src/lua/src/loadlib.c +666 -0
- data/src/lua/src/loadlib_rel.c +719 -0
- data/src/lua/src/lobject.c +214 -0
- data/src/lua/src/lobject.h +381 -0
- data/src/lua/src/lopcodes.c +102 -0
- data/src/lua/src/lopcodes.h +268 -0
- data/src/lua/src/loslib.c +243 -0
- data/src/lua/src/lparser.c +1339 -0
- data/src/lua/src/lparser.h +82 -0
- data/src/lua/src/lstate.c +214 -0
- data/src/lua/src/lstate.h +169 -0
- data/src/lua/src/lstring.c +111 -0
- data/src/lua/src/lstring.h +31 -0
- data/src/lua/src/lstrlib.c +871 -0
- data/src/lua/src/ltable.c +588 -0
- data/src/lua/src/ltable.h +40 -0
- data/src/lua/src/ltablib.c +287 -0
- data/src/lua/src/ltm.c +75 -0
- data/src/lua/src/ltm.h +54 -0
- data/src/lua/src/lua.c +392 -0
- data/src/lua/src/lua.def +131 -0
- data/src/lua/src/lua.h +388 -0
- data/src/lua/src/lua.rc +28 -0
- data/src/lua/src/lua_dll.rc +26 -0
- data/src/lua/src/luac.c +200 -0
- data/src/lua/src/luac.rc +1 -0
- data/src/lua/src/luaconf.h.in +724 -0
- data/src/lua/src/luaconf.h.orig +763 -0
- data/src/lua/src/lualib.h +53 -0
- data/src/lua/src/lundump.c +227 -0
- data/src/lua/src/lundump.h +36 -0
- data/src/lua/src/lvm.c +766 -0
- data/src/lua/src/lvm.h +36 -0
- data/src/lua/src/lzio.c +82 -0
- data/src/lua/src/lzio.h +67 -0
- data/src/lua/src/print.c +227 -0
- data/src/lua/test/README +26 -0
- data/src/lua/test/bisect.lua +27 -0
- data/src/lua/test/cf.lua +16 -0
- data/src/lua/test/echo.lua +5 -0
- data/src/lua/test/env.lua +7 -0
- data/src/lua/test/factorial.lua +32 -0
- data/src/lua/test/fib.lua +40 -0
- data/src/lua/test/fibfor.lua +13 -0
- data/src/lua/test/globals.lua +13 -0
- data/src/lua/test/hello.lua +3 -0
- data/src/lua/test/life.lua +111 -0
- data/src/lua/test/luac.lua +7 -0
- data/src/lua/test/printf.lua +7 -0
- data/src/lua/test/readonly.lua +12 -0
- data/src/lua/test/sieve.lua +29 -0
- data/src/lua/test/sort.lua +66 -0
- data/src/lua/test/table.lua +12 -0
- data/src/lua/test/trace-calls.lua +32 -0
- data/src/lua/test/trace-globals.lua +38 -0
- data/src/lua/test/xd.lua +14 -0
- metadata +115 -2
@@ -0,0 +1,40 @@
|
|
1
|
+
<HTML>
|
2
|
+
<HEAD>
|
3
|
+
<TITLE>Lua documentation</TITLE>
|
4
|
+
<LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
|
5
|
+
</HEAD>
|
6
|
+
|
7
|
+
<BODY>
|
8
|
+
|
9
|
+
<HR>
|
10
|
+
<H1>
|
11
|
+
<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua" BORDER=0></A>
|
12
|
+
Documentation
|
13
|
+
</H1>
|
14
|
+
|
15
|
+
This is the documentation included in the source distribution of Lua 5.1.4.
|
16
|
+
|
17
|
+
<UL>
|
18
|
+
<LI><A HREF="contents.html">Reference manual</A>
|
19
|
+
<LI><A HREF="lua.html">lua man page</A>
|
20
|
+
<LI><A HREF="luac.html">luac man page</A>
|
21
|
+
<LI><A HREF="../README">lua/README</A>
|
22
|
+
<LI><A HREF="../etc/README">lua/etc/README</A>
|
23
|
+
<LI><A HREF="../test/README">lua/test/README</A>
|
24
|
+
</UL>
|
25
|
+
|
26
|
+
Lua's
|
27
|
+
<A HREF="http://www.lua.org/">official web site</A>
|
28
|
+
contains updated documentation,
|
29
|
+
especially the
|
30
|
+
<A HREF="http://www.lua.org/manual/5.1/">reference manual</A>.
|
31
|
+
<P>
|
32
|
+
|
33
|
+
<HR>
|
34
|
+
<SMALL>
|
35
|
+
Last update:
|
36
|
+
Tue Aug 12 14:46:07 BRT 2008
|
37
|
+
</SMALL>
|
38
|
+
|
39
|
+
</BODY>
|
40
|
+
</HTML>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# makefile for Lua etc
|
2
|
+
|
3
|
+
TOP= ..
|
4
|
+
LIB= $(TOP)/src
|
5
|
+
INC= $(TOP)/src
|
6
|
+
BIN= $(TOP)/src
|
7
|
+
SRC= $(TOP)/src
|
8
|
+
TST= $(TOP)/test
|
9
|
+
|
10
|
+
CC= gcc
|
11
|
+
CFLAGS= -O2 -Wall -I$(INC) $(MYCFLAGS)
|
12
|
+
MYCFLAGS=
|
13
|
+
MYLDFLAGS= -Wl,-E
|
14
|
+
MYLIBS= -lm
|
15
|
+
#MYLIBS= -lm -Wl,-E -ldl -lreadline -lhistory -lncurses
|
16
|
+
RM= rm -f
|
17
|
+
|
18
|
+
default:
|
19
|
+
@echo 'Please choose a target: min noparser one strict clean'
|
20
|
+
|
21
|
+
min: min.c
|
22
|
+
$(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS)
|
23
|
+
echo 'print"Hello there!"' | ./a.out
|
24
|
+
|
25
|
+
noparser: noparser.o
|
26
|
+
$(CC) noparser.o $(SRC)/lua.o -L$(LIB) -llua $(MYLIBS)
|
27
|
+
$(BIN)/luac $(TST)/hello.lua
|
28
|
+
-./a.out luac.out
|
29
|
+
-./a.out -e'a=1'
|
30
|
+
|
31
|
+
one:
|
32
|
+
$(CC) $(CFLAGS) all.c $(MYLIBS)
|
33
|
+
./a.out $(TST)/hello.lua
|
34
|
+
|
35
|
+
strict:
|
36
|
+
-$(BIN)/lua -e 'print(a);b=2'
|
37
|
+
-$(BIN)/lua -lstrict -e 'print(a)'
|
38
|
+
-$(BIN)/lua -e 'function f() b=2 end f()'
|
39
|
+
-$(BIN)/lua -lstrict -e 'function f() b=2 end f()'
|
40
|
+
|
41
|
+
clean:
|
42
|
+
$(RM) a.out core core.* *.o luac.out
|
43
|
+
|
44
|
+
.PHONY: default min noparser one strict clean
|
data/src/lua/etc/README
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
This directory contains some useful files and code.
|
2
|
+
Unlike the code in ../src, everything here is in the public domain.
|
3
|
+
|
4
|
+
If any of the makes fail, you're probably not using the same libraries
|
5
|
+
used to build Lua. Set MYLIBS in Makefile accordingly.
|
6
|
+
|
7
|
+
all.c
|
8
|
+
Full Lua interpreter in a single file.
|
9
|
+
Do "make one" for a demo.
|
10
|
+
|
11
|
+
lua.hpp
|
12
|
+
Lua header files for C++ using 'extern "C"'.
|
13
|
+
|
14
|
+
lua.ico
|
15
|
+
A Lua icon for Windows (and web sites: save as favicon.ico).
|
16
|
+
Drawn by hand by Markus Gritsch <gritsch@iue.tuwien.ac.at>.
|
17
|
+
|
18
|
+
lua.pc
|
19
|
+
pkg-config data for Lua
|
20
|
+
|
21
|
+
luavs.bat
|
22
|
+
Script to build Lua under "Visual Studio .NET Command Prompt".
|
23
|
+
Run it from the toplevel as etc\luavs.bat.
|
24
|
+
|
25
|
+
min.c
|
26
|
+
A minimal Lua interpreter.
|
27
|
+
Good for learning and for starting your own.
|
28
|
+
Do "make min" for a demo.
|
29
|
+
|
30
|
+
noparser.c
|
31
|
+
Linking with noparser.o avoids loading the parsing modules in lualib.a.
|
32
|
+
Do "make noparser" for a demo.
|
33
|
+
|
34
|
+
strict.lua
|
35
|
+
Traps uses of undeclared global variables.
|
36
|
+
Do "make strict" for a demo.
|
37
|
+
|
data/src/lua/etc/all.c
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
/*
|
2
|
+
* all.c -- Lua core, libraries and interpreter in a single file
|
3
|
+
*/
|
4
|
+
|
5
|
+
#define luaall_c
|
6
|
+
|
7
|
+
#include "lapi.c"
|
8
|
+
#include "lcode.c"
|
9
|
+
#include "ldebug.c"
|
10
|
+
#include "ldo.c"
|
11
|
+
#include "ldump.c"
|
12
|
+
#include "lfunc.c"
|
13
|
+
#include "lgc.c"
|
14
|
+
#include "llex.c"
|
15
|
+
#include "lmem.c"
|
16
|
+
#include "lobject.c"
|
17
|
+
#include "lopcodes.c"
|
18
|
+
#include "lparser.c"
|
19
|
+
#include "lstate.c"
|
20
|
+
#include "lstring.c"
|
21
|
+
#include "ltable.c"
|
22
|
+
#include "ltm.c"
|
23
|
+
#include "lundump.c"
|
24
|
+
#include "lvm.c"
|
25
|
+
#include "lzio.c"
|
26
|
+
|
27
|
+
#include "lauxlib.c"
|
28
|
+
#include "lbaselib.c"
|
29
|
+
#include "ldblib.c"
|
30
|
+
#include "liolib.c"
|
31
|
+
#include "linit.c"
|
32
|
+
#include "lmathlib.c"
|
33
|
+
#include "loadlib.c"
|
34
|
+
#include "loslib.c"
|
35
|
+
#include "lstrlib.c"
|
36
|
+
#include "ltablib.c"
|
37
|
+
|
38
|
+
#include "lua.c"
|
data/src/lua/etc/lua.hpp
ADDED
data/src/lua/etc/lua.ico
ADDED
Binary file
|
data/src/lua/etc/lua.pc
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# lua.pc -- pkg-config data for Lua
|
2
|
+
|
3
|
+
# vars from install Makefile
|
4
|
+
|
5
|
+
# grep '^V=' ../Makefile
|
6
|
+
V= 5.1
|
7
|
+
# grep '^R=' ../Makefile
|
8
|
+
R= 5.1.4
|
9
|
+
|
10
|
+
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
|
11
|
+
prefix= /usr/local
|
12
|
+
INSTALL_BIN= ${prefix}/bin
|
13
|
+
INSTALL_INC= ${prefix}/include
|
14
|
+
INSTALL_LIB= ${prefix}/lib
|
15
|
+
INSTALL_MAN= ${prefix}/man/man1
|
16
|
+
INSTALL_LMOD= ${prefix}/share/lua/${V}
|
17
|
+
INSTALL_CMOD= ${prefix}/lib/lua/${V}
|
18
|
+
|
19
|
+
# canonical vars
|
20
|
+
exec_prefix=${prefix}
|
21
|
+
libdir=${exec_prefix}/lib
|
22
|
+
includedir=${prefix}/include
|
23
|
+
|
24
|
+
Name: Lua
|
25
|
+
Description: An Extensible Extension Language
|
26
|
+
Version: ${R}
|
27
|
+
Requires:
|
28
|
+
Libs: -L${libdir} -llua -lm
|
29
|
+
Cflags: -I${includedir}
|
30
|
+
|
31
|
+
# (end of lua.pc)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
@rem Script to build Lua under "Visual Studio .NET Command Prompt".
|
2
|
+
@rem Do not run from this directory; run it from the toplevel: etc\luavs.bat .
|
3
|
+
@rem It creates lua51.dll, lua51.lib, lua.exe, and luac.exe in src.
|
4
|
+
@rem (contributed by David Manura and Mike Pall)
|
5
|
+
|
6
|
+
@setlocal
|
7
|
+
@set MYCOMPILE=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE
|
8
|
+
@set MYLINK=link /nologo
|
9
|
+
@set MYMT=mt /nologo
|
10
|
+
|
11
|
+
cd src
|
12
|
+
%MYCOMPILE% /DLUA_BUILD_AS_DLL l*.c
|
13
|
+
del lua.obj luac.obj
|
14
|
+
%MYLINK% /DLL /out:lua51.dll l*.obj
|
15
|
+
if exist lua51.dll.manifest^
|
16
|
+
%MYMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2
|
17
|
+
%MYCOMPILE% /DLUA_BUILD_AS_DLL lua.c
|
18
|
+
%MYLINK% /out:lua.exe lua.obj lua51.lib
|
19
|
+
if exist lua.exe.manifest^
|
20
|
+
%MYMT% -manifest lua.exe.manifest -outputresource:lua.exe
|
21
|
+
%MYCOMPILE% l*.c print.c
|
22
|
+
del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj^
|
23
|
+
loslib.obj ltablib.obj lstrlib.obj loadlib.obj
|
24
|
+
%MYLINK% /out:luac.exe *.obj
|
25
|
+
if exist luac.exe.manifest^
|
26
|
+
%MYMT% -manifest luac.exe.manifest -outputresource:luac.exe
|
27
|
+
del *.obj *.manifest
|
28
|
+
cd ..
|
data/src/lua/etc/min.c
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
/*
|
2
|
+
* min.c -- a minimal Lua interpreter
|
3
|
+
* loads stdin only with minimal error handling.
|
4
|
+
* no interaction, and no standard library, only a "print" function.
|
5
|
+
*/
|
6
|
+
|
7
|
+
#include <stdio.h>
|
8
|
+
|
9
|
+
#include "lua.h"
|
10
|
+
#include "lauxlib.h"
|
11
|
+
|
12
|
+
static int print(lua_State *L)
|
13
|
+
{
|
14
|
+
int n=lua_gettop(L);
|
15
|
+
int i;
|
16
|
+
for (i=1; i<=n; i++)
|
17
|
+
{
|
18
|
+
if (i>1) printf("\t");
|
19
|
+
if (lua_isstring(L,i))
|
20
|
+
printf("%s",lua_tostring(L,i));
|
21
|
+
else if (lua_isnil(L,i))
|
22
|
+
printf("%s","nil");
|
23
|
+
else if (lua_isboolean(L,i))
|
24
|
+
printf("%s",lua_toboolean(L,i) ? "true" : "false");
|
25
|
+
else
|
26
|
+
printf("%s:%p",luaL_typename(L,i),lua_topointer(L,i));
|
27
|
+
}
|
28
|
+
printf("\n");
|
29
|
+
return 0;
|
30
|
+
}
|
31
|
+
|
32
|
+
int main(void)
|
33
|
+
{
|
34
|
+
lua_State *L=lua_open();
|
35
|
+
lua_register(L,"print",print);
|
36
|
+
if (luaL_dofile(L,NULL)!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1));
|
37
|
+
lua_close(L);
|
38
|
+
return 0;
|
39
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/*
|
2
|
+
* The code below can be used to make a Lua core that does not contain the
|
3
|
+
* parsing modules (lcode, llex, lparser), which represent 35% of the total core.
|
4
|
+
* You'll only be able to load binary files and strings, precompiled with luac.
|
5
|
+
* (Of course, you'll have to build luac with the original parsing modules!)
|
6
|
+
*
|
7
|
+
* To use this module, simply compile it ("make noparser" does that) and list
|
8
|
+
* its object file before the Lua libraries. The linker should then not load
|
9
|
+
* the parsing modules. To try it, do "make luab".
|
10
|
+
*
|
11
|
+
* If you also want to avoid the dump module (ldump.o), define NODUMP.
|
12
|
+
* #define NODUMP
|
13
|
+
*/
|
14
|
+
|
15
|
+
#define LUA_CORE
|
16
|
+
|
17
|
+
#include "llex.h"
|
18
|
+
#include "lparser.h"
|
19
|
+
#include "lzio.h"
|
20
|
+
|
21
|
+
LUAI_FUNC void luaX_init (lua_State *L) {
|
22
|
+
UNUSED(L);
|
23
|
+
}
|
24
|
+
|
25
|
+
LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {
|
26
|
+
UNUSED(z);
|
27
|
+
UNUSED(buff);
|
28
|
+
UNUSED(name);
|
29
|
+
lua_pushliteral(L,"parser not loaded");
|
30
|
+
lua_error(L);
|
31
|
+
return NULL;
|
32
|
+
}
|
33
|
+
|
34
|
+
#ifdef NODUMP
|
35
|
+
#include "lundump.h"
|
36
|
+
|
37
|
+
LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) {
|
38
|
+
UNUSED(f);
|
39
|
+
UNUSED(w);
|
40
|
+
UNUSED(data);
|
41
|
+
UNUSED(strip);
|
42
|
+
#if 1
|
43
|
+
UNUSED(L);
|
44
|
+
return 0;
|
45
|
+
#else
|
46
|
+
lua_pushliteral(L,"dumper not loaded");
|
47
|
+
lua_error(L);
|
48
|
+
#endif
|
49
|
+
}
|
50
|
+
#endif
|
@@ -0,0 +1,41 @@
|
|
1
|
+
--
|
2
|
+
-- strict.lua
|
3
|
+
-- checks uses of undeclared global variables
|
4
|
+
-- All global variables must be 'declared' through a regular assignment
|
5
|
+
-- (even assigning nil will do) in a main chunk before being used
|
6
|
+
-- anywhere or assigned to inside a function.
|
7
|
+
--
|
8
|
+
|
9
|
+
local getinfo, error, rawset, rawget = debug.getinfo, error, rawset, rawget
|
10
|
+
|
11
|
+
local mt = getmetatable(_G)
|
12
|
+
if mt == nil then
|
13
|
+
mt = {}
|
14
|
+
setmetatable(_G, mt)
|
15
|
+
end
|
16
|
+
|
17
|
+
mt.__declared = {}
|
18
|
+
|
19
|
+
local function what ()
|
20
|
+
local d = getinfo(3, "S")
|
21
|
+
return d and d.what or "C"
|
22
|
+
end
|
23
|
+
|
24
|
+
mt.__newindex = function (t, n, v)
|
25
|
+
if not mt.__declared[n] then
|
26
|
+
local w = what()
|
27
|
+
if w ~= "main" and w ~= "C" then
|
28
|
+
error("assign to undeclared variable '"..n.."'", 2)
|
29
|
+
end
|
30
|
+
mt.__declared[n] = true
|
31
|
+
end
|
32
|
+
rawset(t, n, v)
|
33
|
+
end
|
34
|
+
|
35
|
+
mt.__index = function (t, n)
|
36
|
+
if not mt.__declared[n] and what() ~= "C" then
|
37
|
+
error("variable '"..n.."' is not declared", 2)
|
38
|
+
end
|
39
|
+
return rawget(t, n)
|
40
|
+
end
|
41
|
+
|
@@ -0,0 +1,182 @@
|
|
1
|
+
# makefile for building Lua
|
2
|
+
# see ../INSTALL for installation instructions
|
3
|
+
# see ../Makefile and luaconf.h for further customization
|
4
|
+
|
5
|
+
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
|
6
|
+
|
7
|
+
# Your platform. See PLATS for possible values.
|
8
|
+
PLAT= none
|
9
|
+
|
10
|
+
CC= gcc
|
11
|
+
CFLAGS= -O2 -Wall $(MYCFLAGS)
|
12
|
+
AR= ar rcu
|
13
|
+
RANLIB= ranlib
|
14
|
+
RM= rm -f
|
15
|
+
LIBS= -lm $(MYLIBS)
|
16
|
+
|
17
|
+
MYCFLAGS=
|
18
|
+
MYLDFLAGS=
|
19
|
+
MYLIBS=
|
20
|
+
|
21
|
+
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
|
22
|
+
|
23
|
+
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
|
24
|
+
|
25
|
+
LUA_A= liblua.a
|
26
|
+
CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
|
27
|
+
lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
|
28
|
+
lundump.o lvm.o lzio.o
|
29
|
+
LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
|
30
|
+
lstrlib.o loadlib.o linit.o
|
31
|
+
|
32
|
+
LUA_T= lua
|
33
|
+
LUA_O= lua.o
|
34
|
+
|
35
|
+
LUAC_T= luac
|
36
|
+
LUAC_O= luac.o print.o
|
37
|
+
|
38
|
+
ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
|
39
|
+
ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
|
40
|
+
ALL_A= $(LUA_A)
|
41
|
+
|
42
|
+
default: $(PLAT)
|
43
|
+
|
44
|
+
all: $(ALL_T)
|
45
|
+
|
46
|
+
o: $(ALL_O)
|
47
|
+
|
48
|
+
a: $(ALL_A)
|
49
|
+
|
50
|
+
$(LUA_A): $(CORE_O) $(LIB_O)
|
51
|
+
$(AR) $@ $?
|
52
|
+
$(RANLIB) $@
|
53
|
+
|
54
|
+
$(LUA_T): $(LUA_O) $(LUA_A)
|
55
|
+
$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
|
56
|
+
|
57
|
+
$(LUAC_T): $(LUAC_O) $(LUA_A)
|
58
|
+
$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
|
59
|
+
|
60
|
+
clean:
|
61
|
+
$(RM) $(ALL_T) $(ALL_O)
|
62
|
+
|
63
|
+
depend:
|
64
|
+
@$(CC) $(CFLAGS) -MM l*.c print.c
|
65
|
+
|
66
|
+
echo:
|
67
|
+
@echo "PLAT = $(PLAT)"
|
68
|
+
@echo "CC = $(CC)"
|
69
|
+
@echo "CFLAGS = $(CFLAGS)"
|
70
|
+
@echo "AR = $(AR)"
|
71
|
+
@echo "RANLIB = $(RANLIB)"
|
72
|
+
@echo "RM = $(RM)"
|
73
|
+
@echo "MYCFLAGS = $(MYCFLAGS)"
|
74
|
+
@echo "MYLDFLAGS = $(MYLDFLAGS)"
|
75
|
+
@echo "MYLIBS = $(MYLIBS)"
|
76
|
+
|
77
|
+
# convenience targets for popular platforms
|
78
|
+
|
79
|
+
none:
|
80
|
+
@echo "Please choose a platform:"
|
81
|
+
@echo " $(PLATS)"
|
82
|
+
|
83
|
+
aix:
|
84
|
+
$(MAKE) all CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl" MYLDFLAGS="-brtl -bexpall"
|
85
|
+
|
86
|
+
ansi:
|
87
|
+
$(MAKE) all MYCFLAGS=-DLUA_ANSI
|
88
|
+
|
89
|
+
bsd:
|
90
|
+
$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-Wl,-E"
|
91
|
+
|
92
|
+
freebsd:
|
93
|
+
$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
|
94
|
+
|
95
|
+
generic:
|
96
|
+
$(MAKE) all MYCFLAGS=
|
97
|
+
|
98
|
+
linux:
|
99
|
+
$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
|
100
|
+
|
101
|
+
macosx:
|
102
|
+
$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
|
103
|
+
# use this on Mac OS X 10.3-
|
104
|
+
# $(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
|
105
|
+
|
106
|
+
mingw:
|
107
|
+
$(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
|
108
|
+
"AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
|
109
|
+
"MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
|
110
|
+
$(MAKE) "LUAC_T=luac.exe" luac.exe
|
111
|
+
|
112
|
+
posix:
|
113
|
+
$(MAKE) all MYCFLAGS=-DLUA_USE_POSIX
|
114
|
+
|
115
|
+
solaris:
|
116
|
+
$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
|
117
|
+
|
118
|
+
# list targets that do not create files (but not all makes understand .PHONY)
|
119
|
+
.PHONY: all $(PLATS) default o a clean depend echo none
|
120
|
+
|
121
|
+
# DO NOT DELETE
|
122
|
+
|
123
|
+
lapi.o: lapi.c lua.h luaconf.h lapi.h lobject.h llimits.h ldebug.h \
|
124
|
+
lstate.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h \
|
125
|
+
lundump.h lvm.h
|
126
|
+
lauxlib.o: lauxlib.c lua.h luaconf.h lauxlib.h
|
127
|
+
lbaselib.o: lbaselib.c lua.h luaconf.h lauxlib.h lualib.h
|
128
|
+
lcode.o: lcode.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \
|
129
|
+
lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h lgc.h \
|
130
|
+
ltable.h
|
131
|
+
ldblib.o: ldblib.c lua.h luaconf.h lauxlib.h lualib.h
|
132
|
+
ldebug.o: ldebug.c lua.h luaconf.h lapi.h lobject.h llimits.h lcode.h \
|
133
|
+
llex.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h \
|
134
|
+
lfunc.h lstring.h lgc.h ltable.h lvm.h
|
135
|
+
ldo.o: ldo.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
|
136
|
+
lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lparser.h lstring.h \
|
137
|
+
ltable.h lundump.h lvm.h
|
138
|
+
ldump.o: ldump.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h \
|
139
|
+
lzio.h lmem.h lundump.h
|
140
|
+
lfunc.o: lfunc.c lua.h luaconf.h lfunc.h lobject.h llimits.h lgc.h lmem.h \
|
141
|
+
lstate.h ltm.h lzio.h
|
142
|
+
lgc.o: lgc.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
|
143
|
+
lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h
|
144
|
+
linit.o: linit.c lua.h luaconf.h lualib.h lauxlib.h
|
145
|
+
liolib.o: liolib.c lua.h luaconf.h lauxlib.h lualib.h
|
146
|
+
llex.o: llex.c lua.h luaconf.h ldo.h lobject.h llimits.h lstate.h ltm.h \
|
147
|
+
lzio.h lmem.h llex.h lparser.h lstring.h lgc.h ltable.h
|
148
|
+
lmathlib.o: lmathlib.c lua.h luaconf.h lauxlib.h lualib.h
|
149
|
+
lmem.o: lmem.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
|
150
|
+
ltm.h lzio.h lmem.h ldo.h
|
151
|
+
loadlib.o: loadlib.c lua.h luaconf.h lauxlib.h lualib.h
|
152
|
+
lobject.o: lobject.c lua.h luaconf.h ldo.h lobject.h llimits.h lstate.h \
|
153
|
+
ltm.h lzio.h lmem.h lstring.h lgc.h lvm.h
|
154
|
+
lopcodes.o: lopcodes.c lopcodes.h llimits.h lua.h luaconf.h
|
155
|
+
loslib.o: loslib.c lua.h luaconf.h lauxlib.h lualib.h
|
156
|
+
lparser.o: lparser.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \
|
157
|
+
lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h \
|
158
|
+
lfunc.h lstring.h lgc.h ltable.h
|
159
|
+
lstate.o: lstate.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
|
160
|
+
ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h llex.h lstring.h ltable.h
|
161
|
+
lstring.o: lstring.c lua.h luaconf.h lmem.h llimits.h lobject.h lstate.h \
|
162
|
+
ltm.h lzio.h lstring.h lgc.h
|
163
|
+
lstrlib.o: lstrlib.c lua.h luaconf.h lauxlib.h lualib.h
|
164
|
+
ltable.o: ltable.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
|
165
|
+
ltm.h lzio.h lmem.h ldo.h lgc.h ltable.h
|
166
|
+
ltablib.o: ltablib.c lua.h luaconf.h lauxlib.h lualib.h
|
167
|
+
ltm.o: ltm.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h lzio.h \
|
168
|
+
lmem.h lstring.h lgc.h ltable.h
|
169
|
+
lua.o: lua.c lua.h luaconf.h lauxlib.h lualib.h
|
170
|
+
luac.o: luac.c lua.h luaconf.h lauxlib.h ldo.h lobject.h llimits.h \
|
171
|
+
lstate.h ltm.h lzio.h lmem.h lfunc.h lopcodes.h lstring.h lgc.h \
|
172
|
+
lundump.h
|
173
|
+
lundump.o: lundump.c lua.h luaconf.h ldebug.h lstate.h lobject.h \
|
174
|
+
llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h lundump.h
|
175
|
+
lvm.o: lvm.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
|
176
|
+
lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h ltable.h lvm.h
|
177
|
+
lzio.o: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \
|
178
|
+
lzio.h
|
179
|
+
print.o: print.c ldebug.h lstate.h lua.h luaconf.h lobject.h llimits.h \
|
180
|
+
ltm.h lzio.h lmem.h lopcodes.h lundump.h
|
181
|
+
|
182
|
+
# (end of Makefile)
|