.PHONY: help build release test clean fmt lint check install run
help:
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
build:
cargo build
release:
cargo build --release
test:
cargo test --all
test-integration:
cargo test --test integration_test
test-unit:
cargo test --lib
clean:
cargo clean
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all -- --check
lint:
cargo clippy --all-targets --all-features -- -D warnings
check: fmt-check lint test
install: release
cargo install --path .
run:
dd if=/dev/urandom bs=2000 count=1 | cargo run
bench:
cargo bench
bench-100mb: release
@echo "Benchmarking hexler with 100MB of random data..."
@dd if=/dev/urandom bs=1M count=100 2>/dev/null | time target/release/hexler --stdout --num-bytes-per-line 16 > /dev/null
@echo "Done!"
doc:
cargo doc --no-deps --open
update:
cargo update
audit:
@which cargo-audit > /dev/null || (echo "cargo-audit not found. Install with: cargo install cargo-audit" && exit 1)
cargo audit
bloat:
@which cargo-bloat > /dev/null || (echo "cargo-bloat not found. Install with: cargo install cargo-bloat" && exit 1)
cargo bloat --release
coverage:
@which cargo-tarpaulin > /dev/null || (echo "cargo-tarpaulin not found. Install with: cargo install cargo-tarpaulin" && exit 1)
cargo tarpaulin --out Html --output-dir coverage
watch:
@which cargo-watch > /dev/null || (echo "cargo-watch not found. Install with: cargo install cargo-watch" && exit 1)
cargo watch -x build
watch-test:
@which cargo-watch > /dev/null || (echo "cargo-watch not found. Install with: cargo install cargo-watch" && exit 1)
cargo watch -x test