.PHONY: all check-release check test clippy doc fmt fmt-check fmt-readme build build-release clean help
all: check-release
check-release: fmt-check fmt-readme check clippy test doc-strict build-release
@echo "[OK] All release checks passed!"
check:
@echo "[CHECK] Running cargo check with all features..."
cargo check --all-targets --all-features
cargo check --all-targets --all-features --tests
cargo check --all-targets --all-features --benches
clippy:
@echo "[CLIPPY] Running clippy with all features..."
cargo clippy --all-targets --all-features -- -D warnings
cargo clippy --all-targets --all-features --tests -- -D warnings
cargo clippy --all-targets --all-features --benches -- -D warnings
test:
@echo "[TEST] Running tests with all features..."
cargo test --all-targets --all-features --lib
test-doc:
@echo "[TEST] Running doctests..."
cargo test --all-features --doc
doc:
@echo "[DOC] Generating documentation with all features..."
cargo doc --all-features --no-deps
doc-strict:
@echo "[DOC] Checking for broken documentation links..."
RUSTDOCFLAGS="-D rustdoc::broken_intra_doc_links" cargo doc --all-features --no-deps --quiet
fmt:
@echo "[FMT] Formatting code..."
cargo fmt
fmt-check:
@echo "[FMT] Checking code formatting..."
cargo fmt --check
fmt-readme:
@echo "[FMT] Formatting README.md..."
markdown-tool format ./README.md
build:
@echo "[BUILD] Building in debug mode with all features..."
cargo build --all-features
build-release:
@echo "[BUILD] Building in release mode with all features..."
cargo build --all-features --release
test-features:
@echo "[TEST] Testing with different feature combinations..."
cargo test --no-default-features
cargo test --features parser
cargo test --features printer
cargo test --features html-printer
cargo test --features latex-printer
cargo test --features ast-transform
cargo test --features ast-serde
cargo test --all-features
audit:
@echo "[AUDIT] Running security audit..."
cargo audit
outdated:
@echo "[DEPS] Checking for outdated dependencies..."
cargo outdated
coverage:
@echo "[COV] Generating test coverage report..."
cargo tarpaulin --all-features --out Html --output-dir coverage
bench:
@echo "[BENCH] Running benchmarks..."
cargo bench --all-features
clean:
@echo "[CLEAN] Cleaning build artifacts..."
cargo clean
rm -rf target/doc
rm -rf coverage
toml-check:
@echo "[TOML] Checking Cargo.toml formatting..."
@if command -v taplo >/dev/null 2>&1; then \
taplo fmt --check Cargo.toml; \
else \
echo "[WARN] taplo not found, skipping TOML formatting check"; \
fi
pre-release: check-release audit toml-check
@echo "[PRE-RELEASE] Running comprehensive pre-release checks..."
@if command -v cargo-outdated >/dev/null 2>&1; then \
$(MAKE) outdated; \
else \
echo "[WARN] cargo-outdated not found, skipping dependency check"; \
fi
@echo "[OK] All pre-release checks completed!"
dev-setup:
@echo "[SETUP] Setting up development environment..."
rustup component add rustfmt clippy
cargo install cargo-audit cargo-outdated taplo-cli
@echo "[OK] Development environment ready!"
watch:
@echo "[WATCH] Watching for changes..."
@if command -v cargo-watch >/dev/null 2>&1; then \
cargo watch -x "test --all-features"; \
else \
echo "[ERROR] cargo-watch not found. Install with: cargo install cargo-watch"; \
fi
help:
@echo "[HELP] Available targets:"
@echo " check-release - Run all release quality checks (default)"
@echo " check - Run cargo check with all features"
@echo " clippy - Run clippy linter with all features"
@echo " test - Run unit tests with all features"
@echo " test-doc - Run doctests (may have feature issues)"
@echo " test-features - Test with different feature combinations"
@echo " doc - Generate documentation"
@echo " doc-strict - Generate documentation with strict checks"
@echo " fmt - Format code"
@echo " fmt-check - Check code formatting"
@echo " fmt-readme - Format README.md"
@echo " build - Build in debug mode"
@echo " build-release - Build in release mode"
@echo " pre-release - Comprehensive pre-release checks"
@echo " audit - Run security audit"
@echo " outdated - Check for outdated dependencies"
@echo " coverage - Generate test coverage report"
@echo " bench - Run benchmarks"
@echo " clean - Clean build artifacts"
@echo " dev-setup - Set up development environment"
@echo " watch - Watch for changes and run tests"
@echo " help - Show this help message"