.PHONY: all build release test test-verbose test-lib lint lint-strict format format-check deny doc-check check check-strict dev quick install clean doc bench ci msrv verify-clean help
all: check
build:
cargo build --all-features --locked
release:
cargo build --release --all-features --locked
test:
cargo test --features fastembed-embeddings --locked
test-verbose:
cargo test --features fastembed-embeddings --locked -- --nocapture
test-lib:
cargo test --lib --features fastembed-embeddings --locked
lint:
cargo clippy --all-targets --all-features --locked
lint-strict:
cargo clippy --all-targets --all-features --locked -- -D warnings
deny:
cargo deny check
doc-check:
cargo doc --no-deps --all-features --locked
format:
cargo fmt
format-check:
cargo fmt -- --check
check: format-check lint test
check-strict: format-check lint-strict test doc-check deny
dev: check install
quick: build install
install:
cargo install --path . --force
clean:
cargo clean
doc:
cargo doc --no-deps --open
bench:
@echo "Benchmarks not yet configured for rlm-rs"
bench-full:
@echo "Benchmarks not yet configured for rlm-rs"
msrv:
@MSRV=$$(grep '^rust-version' Cargo.toml | cut -d'"' -f2); \
echo "Checking MSRV: $$MSRV"; \
rustup run $$MSRV cargo check --all-features --all-targets --locked
verify-clean:
@if [ "$$GITHUB_ACTIONS" = "true" ] || [ "$(REQUIRE_CLEAN)" = "1" ]; then \
git diff --quiet && git diff --cached --quiet || (echo "Working tree is dirty"; exit 1); \
else \
if ! (git diff --quiet && git diff --cached --quiet); then \
echo "Working tree is dirty (continuing)"; \
fi; \
fi
ci: verify-clean format-check lint-strict test doc-check deny msrv build release
publish-dry:
cargo publish --dry-run
publish: check-strict
cargo publish
help:
@echo "RLM-RS Makefile Targets:"
@echo ""
@echo " Build:"
@echo " build Build debug binary"
@echo " release Build release binary"
@echo " install Install to ~/.cargo/bin"
@echo " clean Clean build artifacts"
@echo ""
@echo " Test:"
@echo " test Run all tests"
@echo " test-verbose Run tests with output"
@echo " test-lib Run library tests only"
@echo ""
@echo " Quality:"
@echo " lint Run clippy linting (warnings allowed)"
@echo " lint-strict Run clippy with warnings as errors"
@echo " format Format code"
@echo " format-check Check formatting"
@echo " deny Run supply chain security audit"
@echo " doc-check Build documentation"
@echo " msrv Check MSRV (minimum supported Rust version)"
@echo " check Full check (format + lint + test)"
@echo " check-strict Strict check (format + lint-strict + test + doc + deny)"
@echo " ci CI-style full check (all gates must pass)"
@echo ""
@echo " Workflows:"
@echo " dev Full check then install"
@echo " quick Build and install (skip tests)"
@echo " doc Generate and open documentation"
@echo ""
@echo " Publishing:"
@echo " publish-dry Dry run publish to crates.io"
@echo " publish Publish to crates.io"
@echo ""
@echo " Installation (after publishing):"
@echo " cargo install rlm-cli"
@echo " brew install zircote/tap/rlm-cli"
@echo ""
@echo " CI Gates (run 'make ci' before pushing):"
@echo " 1. cargo fmt -- --check"
@echo " 2. cargo clippy --all-targets --all-features -- -D warnings"
@echo " 3. cargo test --all-features"
@echo " 4. cargo doc --no-deps"
@echo " 5. cargo deny check"
@echo " 6. rustup run \$$MSRV cargo check --all-features"