.PHONY: all build test coverage coverage-quick coverage-full coverage-ci coverage-open coverage-clean bench lint fmt clean help check quick-check hook-install integration
all: fmt lint test
build:
cargo build --release
test:
cargo test
COVERAGE_EXCLUDE = --ignore-filename-regex 'main\.rs'
coverage:
@echo "๐ Running fast coverage analysis..."
@which cargo-llvm-cov > /dev/null 2>&1 || (echo "๐ฆ Installing cargo-llvm-cov..." && cargo install cargo-llvm-cov --locked)
@which cargo-nextest > /dev/null 2>&1 || (echo "๐ฆ Installing cargo-nextest..." && cargo install cargo-nextest --locked)
@mkdir -p target/coverage
@echo "๐งช Running tests with instrumentation..."
@cargo llvm-cov nextest \
--all-features \
--html --output-dir target/coverage/html \
$(COVERAGE_EXCLUDE)
@echo ""
@echo "๐ Coverage Summary:"
@cargo llvm-cov report --summary-only $(COVERAGE_EXCLUDE)
@echo ""
@echo "๐ก HTML report: target/coverage/html/index.html"
coverage-quick:
@echo "โก Running quick coverage..."
@cargo llvm-cov nextest --summary-only
coverage-full:
@echo "๐ฌ Running full coverage analysis..."
@cargo llvm-cov nextest \
--all-features \
--html --output-dir target/coverage/html
@cargo llvm-cov report
coverage-ci:
@echo "๐ค Running CI coverage..."
@cargo llvm-cov nextest \
--all-features \
--lcov --output-path target/coverage/lcov.info
@cargo llvm-cov report --summary-only
coverage-open: coverage
@open target/coverage/html/index.html 2>/dev/null || xdg-open target/coverage/html/index.html 2>/dev/null || echo "Open target/coverage/html/index.html"
coverage-clean:
@rm -rf target/coverage
@cargo llvm-cov clean --workspace
bench:
cargo bench
bench-startup:
cargo bench --bench startup
lint:
cargo clippy --all-targets --all-features
fmt:
cargo fmt
fmt-check:
cargo fmt --check
audit:
@which cargo-audit > /dev/null 2>&1 || cargo install cargo-audit
cargo audit
clean:
cargo clean
profile: build
./target/release/pzsh profile
benchmark: build
./target/release/pzsh bench --iterations 100
status: build
./target/release/pzsh status
book:
@which mdbook > /dev/null 2>&1 || cargo install mdbook
cd book && mdbook build
book-serve:
@which mdbook > /dev/null 2>&1 || cargo install mdbook
cd book && mdbook serve --open
examples:
cargo run --example basic_config
cargo run --example benchmark
cargo run --example lint_config
cargo run --example parser
cargo run --example prompt
check: quick-check
quick-check:
@echo "โก Quick check..."
@cargo fmt --check --quiet
@cargo test --quiet --lib tests::test_startup_under_10ms 2>/dev/null
@cargo build --release --quiet
@echo "โ All checks passed"
integration:
cargo test --test integration
hook-install:
@ln -sf ../../scripts/pre-commit .git/hooks/pre-commit
@echo "โ Pre-commit hook installed"
hook-run:
@./scripts/pre-commit
help:
@echo "pzsh - Performance-first shell framework"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'