Last active
October 14, 2023 18:33
-
-
Save SimonLammer/ba500cc2ba332cfec756bcd5369b40e6 to your computer and use it in GitHub Desktop.
Makefile help (list available make targets)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# have an intermediate _help, to move the actual help target to the file end | |
_help: help | |
#= Section 1 | |
target1: | |
echo target1 | |
target2: target1 | |
echo target2 | |
target3: target2 # target 3 description | |
echo target3 | |
target4: # target 4 description | |
echo target4 | |
#= Miscellaneous | |
help: # Shows this help message | |
@sed -nr \ | |
-e 's/^#= (.*)/\n\n\1:/p' \ | |
-e 's/^([^_][_a-zA-Z0-9-]*):([^#]*)(# (.*))?/ \1|\4/p' \ | |
${MAKEFILE_LIST} \ | |
| column -t -s '|' |
Author
SimonLammer
commented
Aug 26, 2023
•
adapted from https://stackoverflow.com/a/76822685/2808520
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment