Published at June 22, 2019 · 1 min read
Makefiles are awesome. My only gripe is that build targets are not discoverable out of the box. That is where self documenting Makefiles shines. Simply append a description to each make target and the following help target. First add the following to the end of your Makefile help: @awk -F ':|##' '/^[^\t].+?:.*?##/ {\ printf "\033[36m%-30s\033[0m %s\n", $$1, $$NF \ }' $(MAKEFILE_LIST) .DEFAULT_GOAL=help .PHONY=help Then add comments to targets by appending ## some description...