.PHONY: help check audit build clean clippy doc fmt test
podman_mount_dir = /rems
podman_tag = rems: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 build clippy test doc
audit: container
$(podman_run) cargo audit --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2020-0159
build: container
$(podman_run) cargo build
clean:
$(podman_run) cargo clean || rm -rf target
podman rmi $(podman_tag) || true
rm -rf $(CURDIR)/.cache
clippy: container
$(podman_run) cargo clippy --all-targets --all-features -- -D warnings
container:
mkdir -p $(CURDIR)/.cache
podman build --pull -t $(podman_tag) $(podman_volume) --force-rm=true $(CURDIR)
doc: container
$(podman_run) cargo doc --no-deps
fmt: container
$(podman_run) cargo fmt -- --check -v
license: container
$(podman_run) cargo license
shell: container
$(podman_run) bash
test: container
$(podman_run) cargo test