Skip to content

Commit 6e18782

Browse files
authored
Create Makefile-show-help.mk
Signed-off-by: Cooper Fitzgerald <[email protected]>
1 parent 8ef5e45 commit 6e18782

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

install/Makefile-show-help.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DEFAULT_GOAL := show-help
2+
# See <https://gist.github.com/klmr/575726c7e05d8780505a> for explanation.
3+
.PHONY: show-help
4+
show-help:
5+
@echo "$$(tput bold)Please specify a build target. The choices are:$$(tput sgr0)";echo;sed -ne"/^## /{h;s/.*//;:d" -e"H;n;s/^## //;td" -e"s/:.*//;G;s/\\n## /---/;s/\\n/ /g;p;}" ${MAKEFILE_LIST}|LC_ALL='C' sort -f|awk -F --- -v n=$$(tput cols) -v i=19 -v a="$$(tput setaf 6)" -v z="$$(tput sgr0)" '{printf"%s%*s%s ",a,-i,$$1,z;m=split($$2,w," ");l=n-i;for(j=1;j<=m;j++){l-=length(w[j])+1;if(l<= 0){l=n-i-length(w[j])-1;printf"\n%*s ",-i," ";}printf"%s ",w[j];}printf"\n";}'|more $(shell test $(shell uname) == Darwin && echo '-Xr')

0 commit comments

Comments
 (0)