-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (44 loc) · 1.3 KB
/
Copy pathMakefile
File metadata and controls
62 lines (44 loc) · 1.3 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
ZIG ?= ./tools/zig
ZIG_BUILD_FLAGS ?=
LUA_DIR := lua-5.5.0
LUA_SRC := $(LUA_DIR)/src
LUA_C_OUT := build/lua-c
LUA_BIN := $(LUA_C_OUT)/lua
LUAC_BIN := $(LUA_C_OUT)/luac
.PHONY: all lua-c run-lua-c zig run-zig fmt test test-suite test-smoke test-guard test-errors-probe clean
.PHONY: test-suite-zig test-upstream
all: lua-c zig
build:
@mkdir -p build
lua-c: build
$(MAKE) -C $(LUA_SRC) linux
@mkdir -p $(LUA_C_OUT)
@cp -f $(LUA_SRC)/lua $(LUA_BIN)
@cp -f $(LUA_SRC)/luac $(LUAC_BIN)
run-lua-c: lua-c
@$(LUA_BIN)
zig:
@$(ZIG) build $(ZIG_BUILD_FLAGS)
run-zig:
@$(ZIG) build $(ZIG_BUILD_FLAGS) run
fmt:
@$(ZIG) fmt build.zig src
test:
@$(ZIG) build $(ZIG_BUILD_FLAGS) test
test-suite: lua-c zig
@python3 tools/run_tests.py
# Run upstream suite under our Zig VM and compare output against reference Lua.
test-suite-zig: lua-c zig
@python3 tools/run_tests.py --mode compare --prelude ""
# Run a single upstream test file (FILE=errors.lua) under Zig VM and compare.
test-upstream: lua-c zig
@test -n "$(FILE)"
@python3 tools/run_tests.py --mode compare --prelude "" --suite "$(FILE)"
test-smoke: lua-c zig
@python3 tools/smoke_compare.py
test-guard: zig
@python3 tools/regression_guard.py --no-build
test-errors-probe: lua-c zig
@python3 tools/errors_probe.py
clean:
@rm -rf zig-cache zig-out build