Makefile: Add help text template for `make help`

This commit is contained in:
Alex Palaistras 2016-03-06 17:25:04 +00:00
parent c270602e37
commit 15d6669097
1 changed files with 18 additions and 4 deletions

View File

@ -53,6 +53,23 @@ END {
endef
export EXTRACT_MARKDOWN
# Template for help text produced by `make help`.
define HELP_TEXT
$(BOLD)Fawkss The simple CSS preprocessor.$(RESET)
This Makefile contains tasks for processing auxiliary actions, such as
generating documentation or running test cases.
$(UNDERLINE)Available Tasks$(RESET)
$(shell \
awk -F \
':|##' '/^##/ {c=$$2; getline; printf "$(BLUE)%10s$(RESET) %s\\n", $$1, c}' \
$(MAKEFILE_LIST) \
)
endef
export HELP_TEXT
# ----------------
# Rule definitions
# ----------------
@ -89,7 +106,4 @@ $(TESTS):
## Show usage information for this Makefile.
help:
@printf "Fawkss — The simple CSS preprocessor.\n\n"
@printf "$(UNDERLINE)Available Tasks$(RESET)\n\n"
@awk -F ':|##' '/^##/ {c=$$2; getline; printf "$(BLUE)%10s$(RESET) %s\n", $$1, c}' $(MAKEFILE_LIST)
@printf "\n"
@printf "$$HELP_TEXT\n"