-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (76 loc) · 2.25 KB
/
Copy pathMakefile
File metadata and controls
90 lines (76 loc) · 2.25 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
# zkir-crypto Top-Level Makefile
# Orchestrates Rocq verification, code generation, and Rust compilation
.PHONY: all coq generate rust test bench clean help
# Default target
all: coq rust
# Build all Rocq proofs
coq:
@echo "==> Building Rocq proofs..."
cd coq && $(MAKE) all
# Generate Rust code from Rocq proofs
generate: coq
@echo "==> Generating Rust code from Rocq..."
@mkdir -p rust/src/generated/gadgets
@mkdir -p rust/src/generated/crypto
python3 scripts/generate_all.py
# Build Rust library
rust:
@echo "==> Building Rust library..."
cd rust && cargo build --release
# Run all tests
test: rust
@echo "==> Running Rust tests..."
cd rust && cargo test
# Run benchmarks
bench: rust
@echo "==> Running benchmarks..."
cd rust && cargo bench
# Clean all build artifacts
clean:
@echo "==> Cleaning Coq artifacts..."
cd coq && $(MAKE) clean || true
@echo "==> Cleaning Rust artifacts..."
cd rust && cargo clean || true
@echo "==> Cleaning generated code..."
find rust/src/generated -name "*.rs" ! -name "mod.rs" -delete
# Development targets
.PHONY: check fmt clippy doc
# Check Rust code (fast compile check)
check:
@echo "==> Checking Rust code..."
cd rust && cargo check
# Format Rust code
fmt:
@echo "==> Formatting Rust code..."
cd rust && cargo fmt
# Run Clippy lints
clippy:
@echo "==> Running Clippy..."
cd rust && cargo clippy -- -D warnings
# Generate documentation
doc:
@echo "==> Generating documentation..."
cd rust && cargo doc --no-deps --open
# Help target
help:
@echo "zkir-crypto Build System"
@echo ""
@echo "Targets:"
@echo " all - Build Rocq proofs and Rust library (default)"
@echo " coq - Build all Rocq proofs"
@echo " generate - Generate Rust code from Rocq proofs"
@echo " rust - Build Rust library"
@echo " test - Run all tests"
@echo " bench - Run benchmarks"
@echo " clean - Clean all build artifacts"
@echo ""
@echo "Development:"
@echo " check - Fast Rust compilation check"
@echo " fmt - Format Rust code"
@echo " clippy - Run Rust linter"
@echo " doc - Generate and open documentation"
@echo ""
@echo "Directory structure:"
@echo " coq/ - Rocq/Coq verification"
@echo " rust/ - Rust implementation"
@echo " docs/ - Documentation"