Skip to content

Commit b66a151

Browse files
committed
Clarify make usage slightly
I noticed that the `make help` target had some ANSI escape sequences that didn't seem to do anything: @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} Those escape sequences at the end mean "change the color to blue, then change it back to normal". I've seen this pattern copy-pasted around the web for a while, so I was curious to find what it was originally. I did some historical spelunking. The earliest example I can find that closely matches this help target is this: https://www.thapaliya.com/en/writings/well-documented-makefiles/ In this version, there used to be a `<target>` inside the color sequences. I can see why that might be helpful. Otherwise, why have the first line that prints make at all?
1 parent 70aee7b commit b66a151

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ PYTEST ?= $(POETRY) run pytest
8383

8484
.PHONY: help
8585
help: ## Display this help
86-
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
86+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
8787

8888
.PHONY: debug-make
8989
debug-make: ## Shows ~all runtime-set variables

0 commit comments

Comments
 (0)