-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
133 lines (102 loc) · 3.55 KB
/
Copy pathMakefile
File metadata and controls
133 lines (102 loc) · 3.55 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
VERSION := $(shell grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
INSTALL_DIR := $(HOME)/.local/almide
BIN := target/release/almide
.PHONY: build install test test-wasm test-ts check clean fmt release parity cross-target cheatsheet stdlib-docs verify-trust receipt
## Build
build:
cargo build --release
## Install
install: build
@mkdir -p $(INSTALL_DIR)
cp $(BIN) $(INSTALL_DIR)/almide
@mkdir -p $(HOME)/.local/bin
rm -f $(HOME)/.local/bin/almide
cp $(BIN) $(HOME)/.local/bin/almide
@# Install stdlib sources (read-only, for LSP go-to-definition)
@if [ -d $(INSTALL_DIR)/stdlib ]; then chmod -R u+w $(INSTALL_DIR)/stdlib; fi
@rm -rf $(INSTALL_DIR)/stdlib
@cp -r stdlib $(INSTALL_DIR)/stdlib
@chmod -R a-w $(INSTALL_DIR)/stdlib
@echo "Installed almide $(VERSION) to $(INSTALL_DIR)/almide and ~/.local/bin/almide"
@almide --version
## Test
test: build
$(BIN) test
test-rust:
cargo test
test-wasm: build
$(BIN) test --target wasm
test-ts: build
$(BIN) test --target ts
test-all: test-rust test test-wasm test-ts parity
## Parity
parity:
bash tools/stdlib-parity-check.sh
cross-target: build
bash tools/cross-target-check.sh spec/lang
bash tools/cross-target-check.sh spec/stdlib
## Docs
cheatsheet:
@bash tools/generate-stdlib-cheatsheet.sh > /tmp/stdlib-section.md
@echo "Generated stdlib section. Review and update docs/CHEATSHEET.md manually, or run:"
@echo " make cheatsheet-update"
cheatsheet-update:
@python3 tools/update-cheatsheet-stdlib.py
@echo "Updated docs/CHEATSHEET.md stdlib section from TOML definitions."
stdlib-docs:
@python3 tools/generate-stdlib-docs.py --write
@echo "Regenerated docs-site/src/content/docs/stdlib/ from TOML definitions."
## Check
check:
cargo check
## Verify the v1 flight-grade trust chain (the third-party "make verify"):
## the Coq proof + independent re-check + axiom audit, then the proof-carrying
## gate (untrusted compiler emits an ownership certificate, the kernel-proven
## checker re-verifies it), then the MIR core + verifier tests. Requires Rocq/Coq.
verify-trust:
proofs/check.sh
proofs/gate.sh
proofs/corpus-wall.sh
cargo test -p almide-mir
receipt:
proofs/receipt.sh
fmt:
cargo fmt --check 2>/dev/null || true
$(BIN) fmt src/ 2>/dev/null || true
## Clean
clean:
cargo clean
$(BIN) clean 2>/dev/null || true
## Release (bump version, build, install, commit, push, create PR)
release: test-all
@echo "All tests passed. Creating release v$(VERSION)..."
git add Cargo.toml Cargo.lock README.md
git commit -m "Bump version to $(VERSION)"
git push origin develop
@echo "Pushed. Create PR with: make pr"
pr:
@MAIN_SHA=$$(git rev-parse origin/main) && \
BODY=$$(git log --oneline $$MAIN_SHA..HEAD | sed 's/^/- /') && \
gh pr create \
--base main \
--head develop \
--title "v$(VERSION)" \
--body "$$BODY"
## Info
version:
@echo $(VERSION)
help:
@echo "make build - Build release binary"
@echo "make install - Build + install to ~/.local/almide/"
@echo "make test - Run almide spec/exercise tests"
@echo "make test-rust - Run cargo tests"
@echo "make test-wasm - Run WASM target tests"
@echo "make test-ts - Run TS target tests"
@echo "make test-all - Run all test suites"
@echo "make check - cargo check"
@echo "make parity - Verify stdlib parity across RS/TS/WASM"
@echo "make cross-target - Run spec tests on both Rust and TS targets"
@echo "make clean - Clean build artifacts"
@echo "make release - Test + commit + push version bump"
@echo "make pr - Create PR from develop to main"
@echo "make version - Print current version"