SHELL:=/bin/bash

.PHONY: help clean docs install-deps build release test

help:
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

clean: ## Remove artifacts generated by cargo on build
	@cargo clean

docs: ## Generate documentation
	@cargo doc --lib

install-deps: ## Install cargo
	@curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

build: clean ## Build application
	@cargo build

release: ## Release application
	@cargo build --release --color always

test: ## Test application
	@cargo test