Skip to content

Instantly share code, notes, and snippets.

@skylock
Created February 7, 2024 11:46
Show Gist options
  • Save skylock/1d90e424c7ce7da82fffe41d449b8382 to your computer and use it in GitHub Desktop.
Save skylock/1d90e424c7ce7da82fffe41d449b8382 to your computer and use it in GitHub Desktop.
self-documenting-makefile
.DEFAULT_GOAL := help
# VARIABLES
# TARGETS
# See details at from http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## Prints this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
foo: ## This line will be shown as documentation when `make` or `make help` command is used.
bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment