Browse code

Makefile: make help: fix newline wrapping, and missing targets

This patch;

- adds support for multiple newlines
- removes the 1-space indentation of wrapped lines
- allows numerical characters in targets (0-9)

Given these targets:

```Makefile
.PHONY: foobar
foobar: ## runs the foobar lorum ipsum.\nand so pn\nand so on
echo foobar

.PHONY: e2e-tests
e2e-tests: ## runs the end-to-end tests
echo e2e-tests
```

Before this change, the output of `make help` was

```
foobar runs the foobar lorum ipsum.
and so pn\nand so on
```

After this change, the output is:

```
foobar runs the foobar lorum ipsum.
and so pn
and so on
e2e-tests runs the end-to-end tests
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/01/10 20:56:26
Showing 1 changed files
... ...
@@ -143,7 +143,7 @@ cross: build ## cross build the binaries for darwin, freebsd and\nwindows
143 143
 	$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary binary cross
144 144
 
145 145
 help: ## this help
146
-	@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
146
+	@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
147 147
 
148 148
 install: ## install the linux binaries
149 149
 	KEEPBUNDLE=1 hack/make.sh install-binary