|
|
|
|
|
by b5n
978 days ago
|
|
I've found this to come in handy, and it is easy to modify to immediate needs. .DEFAULT_GOAL = help
.PHONY: help
##@ HELP
help: ## display this help
@awk 'BEGIN {FS = ":.*##"; \
printf "\033[1mUSAGE\n\033[0m make \033[36m<TARGET>\033[0m\n"} \
/^[a-zA-Z_-]+\.*[a-zA-Z]*:.*?##/ {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2} \
/^##@/ {printf "\n\033[1m%s\033[0m\n", substr($$0, 5)} \
/^###/ {printf "\033[0m\t\t %s\033[0m\n", substr($$0, 4)}' $(MAKEFILE_LIST)
.PHONY: foo bar baz
##@ DEMO
foo: bar ## foo target
### additional foo target details
@echo foo
bar: ## bar target
@echo bar
baz: ## baz target
@echo baz
|
|