-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
113 lines (87 loc) · 2.9 KB
/
Copy pathMakefile
File metadata and controls
113 lines (87 loc) · 2.9 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
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 check clean fmt release cross-target verify-trust receipt stdlib-docs
## 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-all: test-rust test test-wasm
cross-target: build
bash tools/cross-target-check.sh spec/lang
bash tools/cross-target-check.sh spec/stdlib
## Docs
stdlib-docs:
@python3 tools/gen-stdlib-doc-index.py
## 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-all - Run all test suites"
@echo "make check - cargo check"
@echo "make cross-target - Compare spec test output across native and WASM"
@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"