.DEFAULT_GOAL := build t ?= binname ?= $(shell cat Cargo.toml | grep name | slit -d = -f 2 | tr -d ' \n') toolchain = x86_64-unknown-linux-musl .PHONY: build build: target/doc README.md cargo build README.md: src/* cargo readme > $@ .PHONY: test test: cargo test --no-fail-fast $(t) -- --nocapture target/$(toolchain)/release/$(binname): src/** Cargo.* cargo build --release target/doc: Cargo.* cargo doc .PHONY: install install: target/$(toolchain)/release/$(binname) sudo install -D $< /usr/local/bin/$(binname) .PHONY: lint lint: cargo +nightly clippy -- -Wclippy::pedantic