Makefile
.DEFAULT_GOAL := help
SHELL = /bin/bash
.SHELLFLAGS = -o pipefail -c
MADE ?= $(HOME)/made
.PHONY: all
all: fmt test ## Everything that's a must before committing: fmt, test.
.PHONY: help
help: ## Print info about all commands
@echo "Commands:"
@echo
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[01;32m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: setup
setup: ## One-time dev env setup: activate git hooks.
git config core.hooksPath hack/git-hooks
.PHONY: fmt
fmt: ## Format source in place.
shfmt -w .
.PHONY: check
check: ## Verify-only and fast; run by the pre-commit hook on every commit.
shfmt -d .
.PHONY: test
test: ## Run all tests.
tests/run.sh
.PHONY: install
install: ## Install binaries into $(MADE)/patchette/bin/.
mkdir -p "$(MADE)/patchette/bin"
cp bin/patchette "$(MADE)/patchette/bin/"
Makefile · 878 B · d231dd1498