Created
September 30, 2023 17:44
-
-
Save Dimfred/c8ca3e2c5a720598d3c5d39a87575ee1 to your computer and use it in GitHub Desktop.
make help target (parses the makefile itself and prints the target and description, which is provided behind ##)
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
target1: ## does some stuff | |
echo target1 | |
target2: target1 ## this wil l only print target2 not target1 | |
echo target2 | |
help: ## prints help for target1 and target2 | |
@grep '##' $(MAKEFILE_LIST) \ | |
| grep -Ev 'grep|###' \ | |
| sed -e 's/^\([^:]*\):[^#]*##\([^#]*\)$$/\1:\2/' \ | |
| awk -F ":" '{ printf "%-18s%s\n", $$1 ":", $$2 }' \ | |
| grep -v 'sed' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment