-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (58 loc) · 1.87 KB
/
Makefile
File metadata and controls
75 lines (58 loc) · 1.87 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
71
72
73
74
75
.PHONY: all install gen gen-test gen-test-update check fmt info test build-examples trim-examples validate-wasm test-playwright serve trim trim-test clean
all: clean install gen check fmt info build-examples trim-examples validate-wasm test-playwright trim-test
install:
cd webapi-gen && npm install
cd tests && npm install
gen:
moon run webapi-gen -- webapi-gen/config.json
gen-test:
moon test -p bikallem/webapi-gen
gen-test-update:
moon test --update -p bikallem/webapi-gen
check:
moon check --target js
moon check --target wasm-gc
fmt:
moon fmt
test:
moon test
info:
moon info --target js
build-examples:
moon -C examples build --target js --release
moon -C examples build --target wasm-gc --release
trim-examples:
@moon build webapi/trim --target js
@for wasm in _build/wasm-gc/release/build/bikallem/webapi-examples/*/*.wasm; do \
node _build/js/debug/build/bikallem/webapi/trim/trim.js "$(CURDIR)/$$wasm" --source "$(CURDIR)/webapi/webapi.mjs"; \
done
validate-wasm:
@fails=0; \
for wasm in _build/wasm-gc/release/build/bikallem/webapi-examples/*/*.wasm; do \
name=$$(basename $$(dirname $$wasm)); \
if wasm-tools validate "$$wasm" 2>/dev/null; then \
echo " OK: $$name"; \
else \
echo " FAIL: $$name"; \
fails=$$((fails + 1)); \
fi; \
done; \
if [ $$fails -gt 0 ]; then echo "$$fails wasm binary(ies) failed validation"; exit 1; fi; \
echo "All wasm binaries valid"
test-playwright:
@mkdir -p "$${TMPDIR:-/tmp}"
@cd tests && if node can_run_playwright.mjs; then \
npx playwright test; \
else \
echo "Skipping Playwright tests: sandbox cannot bind localhost or launch Chromium"; \
fi
serve:
node tests/ws-echo-server.mjs & npx serve . -l 3000 --no-clipboard
trim:
moon run webapi/trim -- $(WASM) -o $(OUT)
trim-test:
@mkdir -p "$${TMPDIR:-/tmp}"
moon test -p bikallem/webapi/trim
bash webapi/trim/tests/cli_test.sh
clean:
moon clean