.PHONY: all build test check fmt lint lint-fix clippy doc bench bench-simd bench-rt coverage clean setup help
.PHONY: install-hooks changelog examples wasm wasm-dev wasm-check ts-check check-nostd
.PHONY: test-browser browser-synth
all: check
build:
cargo build --all-features
release:
cargo build --release --all-features
test:
cargo test --all-features
test-verbose:
cargo test --all-features -- --nocapture
test-doc:
cargo test --doc --all-features
check: fmt-check lint test
@echo "All checks passed!"
check-nostd:
cargo rustc --lib --crate-type rlib --no-default-features --target thumbv7em-none-eabihf -- --emit=metadata
cargo rustc --lib --crate-type rlib --no-default-features --features alloc --target thumbv7em-none-eabihf -- --emit=metadata
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all -- --check
lint:
cargo clippy --all-features -- -D warnings
lint-fix:
cargo clippy --all-features --fix --allow-dirty --allow-staged
clippy: lint
doc:
cargo doc --no-deps --all-features --open
doc-build:
cargo doc --no-deps --all-features
doc-book:
mdbook build docs/
doc-serve:
mdbook serve docs/
bench:
cargo bench
cargo bench --features simd
bench-simd:
cargo bench -- simd --save-baseline scalar
cargo bench --features simd -- simd --baseline scalar
bench-rt:
cargo test --release --test realtime_compliance -- --nocapture
bench-test:
cargo bench -- --test
coverage:
cargo llvm-cov --all-features --ignore-filename-regex 'src/wasm/.*' --fail-under-lines 80
coverage-html:
cargo llvm-cov --all-features --ignore-filename-regex 'src/wasm/.*' --html
@echo "Coverage report: target/llvm-cov/html/index.html"
clean:
cargo clean
rm -rf docs/book/
rm -rf pkg/
rm -f tarpaulin-report.html
rm -f packages/@quiver/wasm/quiver*.js packages/@quiver/wasm/quiver*.wasm packages/@quiver/wasm/quiver*.d.ts
setup: install-hooks
rustup component add rustfmt clippy llvm-tools-preview
@echo "Installing cargo-llvm-cov for coverage..."
cargo install cargo-llvm-cov || true
@echo "Installing mdbook for documentation..."
cargo install mdbook mdbook-mermaid || true
@echo "Installing git-cliff for changelog generation..."
cargo install git-cliff || true
@echo "Development environment ready!"
install-hooks:
@echo "Installing git hooks..."
@mkdir -p .git/hooks
@cp .githooks/pre-commit .git/hooks/pre-commit 2>/dev/null || \
echo '#!/bin/sh\nmake pre-commit' > .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "Git hooks installed!"
pre-commit: fmt-check lint
@echo "Pre-commit checks passed!"
changelog:
git cliff --output .github/CHANGELOG.md
@echo "Changelog updated: .github/CHANGELOG.md"
examples:
cargo build --examples --all-features
run-example:
cargo run --example $(NAME)
quick-taste:
cargo run --example quick_taste
watch:
cargo watch -x "test --all-features"
watch-check:
cargo watch -x "check --all-features"
wasm:
wasm-pack build --target web --no-default-features --features wasm
cp pkg/quiver.js pkg/quiver.d.ts pkg/quiver_bg.wasm pkg/quiver_bg.wasm.d.ts packages/@quiver/wasm/
@echo "WASM package built: packages/@quiver/wasm/"
wasm-dev:
wasm-pack build --dev --target web --no-default-features --features wasm
cp pkg/quiver.js pkg/quiver.d.ts pkg/quiver_bg.wasm pkg/quiver_bg.wasm.d.ts packages/@quiver/wasm/
@echo "WASM package built (dev): packages/@quiver/wasm/"
wasm-check:
cargo check --target wasm32-unknown-unknown --no-default-features --features wasm
ts-check:
@echo "Checking TypeScript..."
@cd packages/@quiver/types && npx tsc --noEmit 2>/dev/null || (npm install --silent && npx tsc --noEmit)
@echo "TypeScript OK"
test-browser: wasm
@echo "Running browser tests..."
@cd demos/browser/tests && npm install --silent && npx playwright install --with-deps chromium && npx playwright test --project=chromium
test-browser-all: wasm
@echo "Running browser tests on all browsers..."
@cd demos/browser/tests && npm install --silent && npx playwright install --with-deps && npx playwright test
browser-synth: wasm
@echo "Starting browser synth demo..."
@cd demos/browser && npm install --silent && npm run dev
demo: browser-synth
help:
@echo "Quiver Development Commands"
@echo ""
@echo "Building:"
@echo " make build - Build the project"
@echo " make release - Build in release mode"
@echo " make wasm - Build WASM package (release)"
@echo " make wasm-dev - Build WASM package (development)"
@echo " make wasm-check - Check WASM compilation"
@echo " make ts-check - Check TypeScript compilation"
@echo " make clean - Clean build artifacts"
@echo ""
@echo "Testing:"
@echo " make test - Run all tests"
@echo " make test-verbose - Run tests with output"
@echo " make test-doc - Run documentation tests"
@echo " make coverage - Run tests with coverage (80% line threshold)"
@echo " make coverage-html- Generate HTML coverage report"
@echo " make bench - Run benchmarks (scalar + SIMD builds)"
@echo " make bench-simd - Scalar-vs-SIMD A/B (criterion baselines)"
@echo " make bench-rt - Real-time compliance gate (release)"
@echo ""
@echo "Code Quality:"
@echo " make check - Run all checks (fmt, lint, test)"
@echo " make check-nostd - Verify no_std/alloc feature tiers (thumbv7em-none-eabihf)"
@echo " make fmt - Format code"
@echo " make fmt-check - Check formatting"
@echo " make lint - Run clippy"
@echo " make lint-fix - Fix clippy issues automatically"
@echo ""
@echo "Documentation:"
@echo " make doc - Build and open rustdoc"
@echo " make doc-build - Build rustdoc only"
@echo " make doc-book - Build mdbook"
@echo " make doc-serve - Serve mdbook locally"
@echo ""
@echo "Examples:"
@echo " make examples - Build all examples"
@echo " make quick-taste - Run quick_taste example"
@echo " make run-example NAME=<name> - Run specific example"
@echo ""
@echo "Demos:"
@echo " make browser-synth- Run browser synth demo (demos/browser/)"
@echo ""
@echo "Browser Testing:"
@echo " make test-browser - Run browser tests (Chromium only)"
@echo " make test-browser-all - Run browser tests (all browsers)"
@echo ""
@echo "Setup:"
@echo " make setup - Setup development environment"
@echo " make install-hooks- Install git hooks"
@echo " make changelog - Generate changelog (requires git-cliff)"
@echo ""
@echo "Watching:"
@echo " make watch - Watch and run tests on changes"
@echo " make watch-check - Watch and check on changes"