-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (58 loc) · 2 KB
/
Copy pathMakefile
File metadata and controls
73 lines (58 loc) · 2 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
# =============================================================================
# quire-wasm Makefile
# =============================================================================
CARGO ?= cargo
WASM_PACK ?= wasm-pack
# Test parity uses the in-repo spec-artifacts-iso module sibling.
QUIRE_WASM_TEST_MODULE_ROOT ?= $(abspath ../spec-artifacts-iso/spec_artifacts_iso)
.PHONY: help
help:
@echo "Available targets:"
@echo " make fmt - Format with rustfmt"
@echo " make fmt-check - Verify formatting (CI gate)"
@echo " make lint - Clippy with -D warnings"
@echo " make test - wasm-pack test --node (parity tests)"
@echo " make test-filament - compare generated WASM extraction with PyO3 quire"
@echo " make build - wasm-pack build --target web --release"
@echo " make build-node - wasm-pack build --target nodejs --release"
@echo " make clean - cargo clean + rm -rf pkg/"
@echo " make deny - cargo deny check licenses"
@echo " make audit-unsafe - Enforce // SAFETY: comments on unsafe blocks"
@echo " make pack - npm pack (produces .tgz tarball)"
@echo " make ci - fmt-check + lint + test + deny + audit-unsafe"
.PHONY: fmt
fmt:
$(CARGO) fmt --all
.PHONY: fmt-check
fmt-check:
$(CARGO) fmt --all -- --check
.PHONY: lint
lint:
$(CARGO) clippy --all-targets --target wasm32-unknown-unknown -- -D warnings
.PHONY: test
test:
QUIRE_WASM_TEST_MODULE_ROOT=$(QUIRE_WASM_TEST_MODULE_ROOT) $(WASM_PACK) test --node
.PHONY: test-filament
test-filament:
node tests/filament_core_parity.mjs
.PHONY: build
build:
$(WASM_PACK) build --target web --release
.PHONY: build-node
build-node:
$(WASM_PACK) build --target nodejs --release
.PHONY: clean
clean:
$(CARGO) clean
rm -rf pkg/
.PHONY: deny
deny:
$(CARGO) deny check licenses
.PHONY: audit-unsafe
audit-unsafe:
bash scripts/check_unsafe_comments.sh
.PHONY: pack
pack: build
cd pkg && npm pack
.PHONY: ci
ci: fmt-check lint test deny audit-unsafe