Idea comes from Payton White's gist Makefile.
Enhanced by good comments from the community:
- https://gist.github.com/prwhite/8168133#gistcomment-1716694
- https://gist.github.com/prwhite/8168133#gistcomment-1737630
- Copy
help
target to your Makefile. - Mark each Makefile target with
##
comment:
target: ## This is the help line
- Group your targets using
##@
comments:
another_target: ##@Grouped This will show up as 'Grouped targets'
other_target: ##@Grouped This will show right next to the 'another_target'
- Use
make
to show help!
Usage: make [target] ...
Targets:
help Show this help message.
target This is the help line
Grouped targets:
another_target This will show up as 'Grouped targets'
other_target This will show right next to the 'another_target'