Merge pull request #736 from codeinabox/makefile-help

Snippet for `help` target for self-documented Makefile
This commit is contained in:
Louis Pilfold 2016-05-17 15:35:04 +01:00
commit f6d0b68e47

View File

@ -43,3 +43,8 @@ snippet el
# .DEFAULT_GOAL := target # .DEFAULT_GOAL := target
snippet default snippet default
.DEFAULT_GOAL := ${1} .DEFAULT_GOAL := ${1}
# help target for self-documentated Makefile
snippet help
help: ## Prints help for targets with comments
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $\$1, $\$2}'
${0}