Skip to content

Instantly share code, notes, and snippets.

@amcgregor
Last active August 28, 2025 21:39
Show Gist options
  • Save amcgregor/35be9073735aaf45fc48499bba150d45 to your computer and use it in GitHub Desktop.
Save amcgregor/35be9073735aaf45fc48499bba150d45 to your computer and use it in GitHub Desktop.
A sample block of Makefile automation to generate very pretty help text.
help: ## Show this help message and exit.
@echo "Usage: make <command>\n\033[36m\033[0m"
@awk 'BEGIN {FS = ":.*##"} /^[a-zA-Z_-]+:.*?##/ { printf "\033[36m%-18s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
@amcgregor
Copy link
Author

Example output:

Output from the Marrow Valsi project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment