.PHONY: clean build test build_test fmt clippy create_docs ayce default help docs test-nightly clippy-nightly nightly tree tree-duplicates deny audit unused-deps install-tools watch install-watch check-wasm generate-hups-bin test-debug-json
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 test-debug-json - Run tests with debug-json feature (save/load use JSON)"
@echo " make build_test - Clean once, then build and test"
@echo " make fmt - Format code"
@echo " make clippy - Run clippy linter"
@echo " make create_docs - Build documentation"
@echo " make docs - Build docs and open in browser"
@echo " make ayce - Run fmt, build_test, clippy, and docs"
@echo " make help - Display this help message"
@echo ""
@echo "Nightly:"
@echo " make test-nightly - Run all tests with nightly"
@echo " make clippy-nightly - Run clippy with nightly and deny warnings"
@echo " make nightly - Run nightly test and clippy checks"
@echo " make unused-deps - Find unused dependencies with cargo-udeps"
@echo ""
@echo "Dependencies and Security:"
@echo " make tree - Show dependency tree"
@echo " make tree-duplicates - Show duplicate dependencies"
@echo " make deny - Run full cargo-deny checks"
@echo " make audit - Run advisory-only security audit"
@echo ""
@echo "WebAssembly:"
@echo " make check-wasm - Check the library compiles for wasm32-unknown-unknown"
@echo " make generate-hups-bin - Generate generated/hups.bin for WASM embedded store"
@echo ""
@echo "Tools and Workflow:"
@echo " make install-tools - Install cargo-deny and cargo-udeps"
@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
test-debug-json:
cargo test --features debug-json
build_test: clean build test
fmt:
cargo fmt
clippy:
cargo clippy -- -W clippy::pedantic
test-nightly:
cargo +nightly test --all-targets --all-features
clippy-nightly:
cargo +nightly clippy --lib --all-features -- -D warnings
nightly: test-nightly clippy-nightly
tree:
@echo "Showing dependency tree..."
cargo tree --workspace
tree-duplicates:
@echo "Showing duplicate dependencies..."
cargo tree --workspace --duplicates
deny:
@echo "Running cargo-deny checks..."
cargo deny check
audit:
@echo "Running security audit..."
cargo deny check advisories
unused-deps:
@echo "Checking for unused dependencies..."
cargo +nightly udeps --workspace --all-features
create_docs:
cargo doc --no-deps
docs: create_docs
@DOC_PATH="./target/doc/pkcore/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: fmt build_test clippy create_docs
install-tools:
@echo "Installing development tools..."
cargo install cargo-deny
cargo install cargo-udeps
@echo ""
@echo "✓ Tools installed!"
@echo ""
watch:
cargo watch -x "check --workspace" -x "test --workspace"
install-watch:
cargo install cargo-watch
check-wasm:
cargo check --target wasm32-unknown-unknown
generate-hups-bin:
cargo run --example export_hups_bin