.PHONY: default help clean build test ci bench build_test fmt fmt-check clippy create_docs docs ayce tree tree-duplicates watch install-watch
default: ayce
help:
@echo "Available targets:"
@echo " make (default) - Run ayce"
@echo " make build - Build the project"
@echo " make clean - Clean build artifacts"
@echo " make test - Run tests"
@echo " make ci - Mirror GitHub Actions test job (RUSTFLAGS=-Dwarnings)"
@echo " make bench - Run criterion benchmarks"
@echo " make build_test - Clean, build, test, and doc tests"
@echo " make fmt - Format code"
@echo " make fmt-check - Check formatting without modifying (matches CI)"
@echo " make clippy - Run clippy linter (matches CI strictness)"
@echo " make create_docs - Build documentation"
@echo " make docs - Build docs and open in browser"
@echo " make ayce - Run fmt, build_test, clippy, and create_docs"
@echo " make help - Display this help message"
@echo ""
@echo "Dependencies:"
@echo " make tree - Show dependency tree"
@echo " make tree-duplicates - Show duplicate dependencies"
@echo ""
@echo "Tools and Workflow:"
@echo " make watch - Run cargo-watch for check/test loop"
@echo " make install-watch - Install cargo-watch"
@echo ""
clean:
cargo clean
build:
cargo build
test:
cargo test
ci:
RUSTFLAGS="-Dwarnings" cargo test --all
bench:
cargo bench
build_test: clean build test
cargo test --doc
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all -- --check
clippy:
cargo clippy -- -Dclippy::all -Dclippy::pedantic
tree:
cargo tree
tree-duplicates:
cargo tree --duplicates
create_docs:
cargo doc --no-deps
docs: create_docs
@DOC_PATH="./target/doc/rnglib/index.html"; \
if command -v xdg-open >/dev/null 2>&1; then \
xdg-open "$$DOC_PATH"; \
elif command -v open >/dev/null 2>&1; then \
open "$$DOC_PATH"; \
else \
echo "No supported opener found (tried xdg-open and open)."; \
echo "Open $$DOC_PATH manually."; \
exit 1; \
fi
ayce: export RUSTFLAGS := -Dwarnings
ayce: fmt build_test clippy create_docs
watch:
cargo watch -x check -x test
install-watch:
cargo install cargo-watch