Makefiles — add a make help command



This content originally appeared on DEV Community and was authored by Anton Dolganin

If you’re using Makefiles — add a make help command.
It auto-parses comments and shows all tasks instantly.

Simple hack, huge productivity boost.

help:
    @awk 'BEGIN {FS=":"} \
    /^#/ {comment=substr($$0,3)} \
    /^[a-zA-Z0-9_-]+:/ {printf "\033[36m%-20s\033[0m %s\n", $$1, comment}' Makefile


This content originally appeared on DEV Community and was authored by Anton Dolganin