.PHONY: help build test clean install run demo fmt lint audit release
help:
@echo "ETH.id - Zero-Knowledge Document Verification"
@echo "=============================================="
@echo ""
@echo "Available targets:"
@echo " make build - Build debug binary"
@echo " make release - Build optimized release binary"
@echo " make test - Run all tests"
@echo " make test-unit - Run unit tests only"
@echo " make test-int - Run integration tests only"
@echo " make test-adv - Run adversarial tests only"
@echo " make clean - Clean build artifacts"
@echo " make install - Install binary globally"
@echo " make run - Run with example document"
@echo " make demo - Run interactive demo"
@echo " make fmt - Format code"
@echo " make lint - Run clippy linter"
@echo " make audit - Security audit"
@echo " make docs - Generate documentation"
@echo " make check - Run all checks (fmt, lint, test)"
build:
@echo "π¨ Building debug binary..."
cargo build
release:
@echo "π Building release binary..."
cargo build --release
@echo "β
Binary: target/release/eth"
@ls -lh target/release/eth
test:
@echo "π§ͺ Running all tests..."
cargo test
test-unit:
@echo "π§ͺ Running unit tests..."
cargo test --lib
test-int:
@echo "π§ͺ Running integration tests..."
cargo test --test integration_e2e
test-adv:
@echo "π§ͺ Running adversarial tests..."
cargo test --test adversarial_tests
test-claims:
@echo "π§ͺ Running claims tests..."
cargo test --test claims_tests
test-privacy:
@echo "π§ͺ Running privacy tests..."
cargo test --test privacy_tests
clean:
@echo "π§Ή Cleaning build artifacts..."
cargo clean
@rm -rf target/
@echo "β
Clean complete"
install: release
@echo "π¦ Installing binary..."
@./scripts/install.sh
run:
@echo "π Running with example document..."
cargo run -- verify \
--doc examples/sample_documents/brazilian_id.txt \
--claim "maior de 18 anos" \
--output text
demo:
@echo "π¬ Running interactive demo..."
@./examples/demo.sh
fmt:
@echo "π¨ Formatting code..."
cargo fmt --all
lint:
@echo "π Running clippy..."
cargo clippy -- -D warnings
audit:
@echo "π Running security audit..."
cargo audit || echo "Install cargo-audit: cargo install cargo-audit"
docs:
@echo "π Generating documentation..."
cargo doc --no-deps --open
check: fmt lint test
@echo "β
All checks passed!"
bench:
@echo "β‘ Running benchmarks..."
cargo bench
watch:
@echo "π Watching for changes..."
cargo watch -x build -x test
coverage:
@echo "π Generating coverage report..."
cargo tarpaulin --out Html --output-dir coverage || echo "Install tarpaulin: cargo install cargo-tarpaulin"
dev-setup:
@echo "π οΈ Setting up development environment..."
rustup component add rustfmt clippy
cargo install cargo-watch cargo-audit cargo-tarpaulin || true
@echo "β
Development environment ready"
example-age:
cargo run -- verify --doc examples/sample_documents/brazilian_id.txt --claim "maior de 18 anos"
example-cpf:
cargo run -- verify --doc examples/sample_documents/brazilian_id.txt --claim "CPF bate com 123.456.789-09"
example-income:
cargo run -- verify --doc examples/sample_documents/income_proof.txt --claim "renda acima de 5000"
example-passport:
cargo run -- verify --doc examples/sample_documents/passport.txt --claim "passaporte estΓ‘ expirado"
example-debug:
cargo run -- verify --doc examples/sample_documents/brazilian_id.txt --claim "maior de 18 anos" --debug
audit-list:
cargo run -- audit --list
audit-config:
cargo run -- config --show
zk-info:
cargo run -- zk
build-all:
@echo "π Building for all platforms..."
cargo build --release --target x86_64-unknown-linux-gnu
cargo build --release --target x86_64-apple-darwin
cargo build --release --target x86_64-pc-windows-gnu
docker-build:
@echo "π³ Building Docker image..."
docker build -t eth-id:latest .
docker-run:
@echo "π³ Running in Docker..."
docker run -it --rm eth-id:latest
q: build test
@echo "β
Quick build and test complete"
qq: build
@echo "β
Quick build complete"