Skip to content

Instantly share code, notes, and snippets.

@dewe
Created June 26, 2019 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dewe/d698ccf542e5d280235bc767a3c8c0f5 to your computer and use it in GitHub Desktop.
Save dewe/d698ccf542e5d280235bc767a3c8c0f5 to your computer and use it in GitHub Desktop.
makefile help target with extra line after help printout
help: ## Display this help (thanks to https://suva.sh/posts/well-documented-makefiles)
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } /\Z/ { printf "\n"}' $(MAKEFILE_LIST)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment