pynezz.dev
login

Makefile auto help generation

Makefile Auto Help Generation

A clean and neat way to generate help for a Makefile:

# This is a simple Makefile with auto-generated help
.PHONY: help

example: ## This is an example target
    @echo "This is an example target"

# asdasd
serve: ## Serve the application
    @echo "Serving the application..."

extra: ## More versatile help
	@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9][^\t ]*:.*?##/ {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

help: ## Simple help
    @grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN{FS=":.*?## "}{printf "  %-16s %s\n", $$1, $$2}'

alt text

alt text

Menu
Observatory A+ 120