.PHONY: help check audit build clean clippy doc fmt test test_release
podman_mount_dir = /devel
podman_tag = yubibomb:dev
podman_volume = -v $(CURDIR):$(podman_mount_dir):z -v $(CURDIR)/.cache:/root/.cargo/registry:z
podman_run = podman run --network=host --rm -it $(podman_volume) -w $(podman_mount_dir) $(podman_tag)
help:
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
check: fmt audit test_release build clippy test doc
audit: container
$(podman_run) cargo audit
build:
cargo build
clean:
cargo clean || rm -rf target
podman rmi $(podman_tag) || true
rm -rf $(CURDIR)/.cache
clippy:
cargo clippy --all-targets --all-features -- -D warnings
container:
mkdir -p $(CURDIR)/.cache
podman build --pull -t $(podman_tag) $(podman_volume) --force-rm=true -f Dockerfile $(CURDIR)
doc:
cargo doc --no-deps
fmt:
cargo fmt -- --check -v
license: container
$(podman_run) cargo license
shell: container
$(podman_run) bash
test:
cargo test
test_release:
cargo test --release