forked from actboy168/lua-debug
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake_buildtools.lua
More file actions
70 lines (63 loc) · 1.61 KB
/
make_buildtools.lua
File metadata and controls
70 lines (63 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
local lm = require "luamake"
--the generated file must store into different directory
local defined = require "compile.luajit.defined"
local arch = defined.arch
local LUAJIT_ENABLE_LUA52COMPAT = defined.LUAJIT_ENABLE_LUA52COMPAT
local LUAJIT_NUMMODE = defined.LUAJIT_NUMMODE
local luajitDir = defined.luajitDir
local LUAJIT_TARGET = string.format("LUAJIT_TARGET=LUAJIT_ARCH_%s", string.upper(arch))
local LJ_ARCH_HASFPU = "LJ_ARCH_HASFPU=1"
local LJ_ABI_SOFTFP = "LJ_ABI_SOFTFP=0"
lm:executable("minilua") {
rootdir = luajitDir,
defines = {
LUAJIT_TARGET,
LJ_ARCH_HASFPU,
LJ_ABI_SOFTFP,
LUAJIT_ENABLE_LUA52COMPAT,
LUAJIT_NUMMODE
},
sources = { "host/minilua.c" },
links = { "m" }
}
local arch_flags = {
"-D", "ENDIAN_LE",
"-D", "P64",
"-D", "JIT",
"-D", "FFI",
"-D", "FPU",
"-D", "HFABI",
"-D", "VER=80",
"-D", "DUALNUM"
}
lm:build("builvm_arch.h") {
deps = "minilua",
args = {
lm.bindir .. "/minilua",
luajitDir .. "/../dynasm/dynasm.lua",
arch_flags,
"-o", "$out", "$in",
},
inputs = luajitDir .. string.format("/vm_%s.dasc", arch),
outputs = lm.bindir .. "/buildvm_arch.h"
}
lm:executable("buildvm") {
rootdir = luajitDir,
deps = "builvm_arch.h",
objdeps = { lm.bindir .. "/buildvm_arch.h" },
defines = {
LUAJIT_TARGET,
LJ_ARCH_HASFPU,
LJ_ABI_SOFTFP,
LUAJIT_ENABLE_LUA52COMPAT,
LUAJIT_NUMMODE
},
sources = {
"host/*.c",
"!host/minilua.c"
},
includes = {
".",
"../../../../" .. lm.bindir
}
}