4 ms·
Here is a version with no dependencies to grep or awk but just sed. I did not tested it on OS X yet. help: @eval $$(sed -r -n 's/^([a-zA-Z0-9_-]+):.*?
by beaufils 11y ago
Here is a version with no dependencies to grep or awk but just sed. I did not tested it on OS X yet.
help:
@eval $$(sed -r -n 's/^([a-zA-Z0-9_-]+):.*?## (.*)$$/printf "\\033[36m%-30s\\033[0m %s\\n" "\1" "\2" ;/; ta; b; :a p' $(MAKEFILE_LIST) | sort)
- LukeShu 11y agoI don't have an OS X box, but I do know that you'll need to change the `-r` to `-E` (GNU sed vs BSD sed). Recent versions of GNU sed (4.2+, I think) also accept `-E` for compatibility with BSD sed (though this is undocumented).