Last active
November 2, 2023 10:18
-
-
Save gleox/aa29dd5535f4bb75e67c3eaebe2bdfac to your computer and use it in GitHub Desktop.
Makefile help target
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
## help : Show this help. | |
help: Makefile | |
@printf "Usage: make [target] [VARIABLE=value]\nTargets:\n" | |
@sed -n 's/^## //p' $< | awk 'BEGIN {FS = ":"}; { if(NF>1 && $$2!="") printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 ; else printf "%40s\n", $$1};' | |
@printf "Variables:\n" | |
@grep -E "^[A-Za-z0-9_]*\?=" $< | awk 'BEGIN {FS = "\\?="}; { printf " \033[36m%-25s\033[0m Default values: %s\n", $$1, $$2}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment