.PHONY: help build release test clean install dev check fmt lint run doc all
.DEFAULT_GOAL := help
BINARY_NAME := micropub
INSTALL_PATH := ~/.local/bin
help:
@echo "micropub CLI - Makefile targets:"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
all: fmt lint test build
build:
cargo build
release:
cargo build --release
test:
cargo test
check:
cargo check
fmt:
cargo fmt
lint:
cargo clippy -- -D warnings
doc:
cargo doc --open --no-deps
clean:
cargo clean
rm -rf target/
install: release
@mkdir -p $(INSTALL_PATH)
cp target/release/$(BINARY_NAME) $(INSTALL_PATH)/
@echo "Installed $(BINARY_NAME) to $(INSTALL_PATH)"
uninstall:
rm -f $(INSTALL_PATH)/$(BINARY_NAME)
@echo "Uninstalled $(BINARY_NAME) from $(INSTALL_PATH)"
dev:
cargo run --
run: release
./target/release/$(BINARY_NAME)
watch:
cargo watch -x build
watch-test:
cargo watch -x test
bloat:
cargo bloat --release
audit:
cargo audit
update:
cargo update
bench:
cargo bench
coverage:
cargo tarpaulin --out Html --output-dir coverage
deps:
cargo tree
outdated:
cargo outdated