CARGO ?= cargo
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
.DEFAULT_GOAL := build
.PHONY: build release test fmt fmt-check lint check run install uninstall clean
build:
$(CARGO) build
release:
$(CARGO) build --release
test:
$(CARGO) test --all
fmt:
$(CARGO) fmt --all
fmt-check:
$(CARGO) fmt --all --check
lint:
$(CARGO) clippy --all-targets -- -D warnings
check: fmt-check lint test
run:
$(CARGO) run -- $(ARGS)
install: release
install -d $(BINDIR)
install -m 0755 target/release/spm $(BINDIR)/spm
uninstall:
rm -f $(BINDIR)/spm
clean:
$(CARGO) clean
help:
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## //'