Add self-documenting Makefile

This Makefile is quite simple for now. But in the future i plan to
create multiple ansible role skeletons and this Makefile can simplify
the usage of these quite a bit.

I learned about self-documenting Makefiles from Sheo's Blog [1] and the
referenced article from Victoria Drake [2].

[1] https://shivering-isles.com/til/2021/05/self-documenting-makefiles
[2] https://victoria.dev/blog/how-to-create-a-self-documenting-makefile/
This commit is contained in:
histalek 2021-06-01 10:25:54 +02:00 committed by saibotk
parent 6ab8adfd0a
commit 39476da79e
Signed by: saibotk
GPG key ID: 67585F0065E261D5
2 changed files with 15 additions and 0 deletions

View file

@ -9,6 +9,9 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[Makefile]
indent_style = tab
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

12
Makefile Normal file
View file

@ -0,0 +1,12 @@
SHELL := /bin/bash
.POSIX:
.PHONY: help lint install
help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
lint: ## Lint ansible files with ansible-lint
ansible-lint
install: ## Install or update requirements
ansible-galaxy install -f -r requirements.yml