Makefiles — add a make help command

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 “\0…


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


Print Share Comment Cite Upload Translate Updates
APA

Anton Dolganin | Sciencx (2025-11-19T17:48:57+00:00) Makefiles — add a make help command. Retrieved from https://www.scien.cx/2025/11/19/makefiles-add-a-make-help-command/

MLA
" » Makefiles — add a make help command." Anton Dolganin | Sciencx - Wednesday November 19, 2025, https://www.scien.cx/2025/11/19/makefiles-add-a-make-help-command/
HARVARD
Anton Dolganin | Sciencx Wednesday November 19, 2025 » Makefiles — add a make help command., viewed ,<https://www.scien.cx/2025/11/19/makefiles-add-a-make-help-command/>
VANCOUVER
Anton Dolganin | Sciencx - » Makefiles — add a make help command. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/11/19/makefiles-add-a-make-help-command/
CHICAGO
" » Makefiles — add a make help command." Anton Dolganin | Sciencx - Accessed . https://www.scien.cx/2025/11/19/makefiles-add-a-make-help-command/
IEEE
" » Makefiles — add a make help command." Anton Dolganin | Sciencx [Online]. Available: https://www.scien.cx/2025/11/19/makefiles-add-a-make-help-command/. [Accessed: ]
rf:citation
» Makefiles — add a make help command | Anton Dolganin | Sciencx | https://www.scien.cx/2025/11/19/makefiles-add-a-make-help-command/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.