Last active
August 28, 2025 21:39
-
-
Save amcgregor/35be9073735aaf45fc48499bba150d45 to your computer and use it in GitHub Desktop.
A sample block of Makefile automation to generate very pretty help text.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output: