View source 
Por Daniel Cheng at NYC
all: commands
## commands : show all commands
commands:
@grep -E '^##' Makefile | sed 's/## //g'
## dothis : do this thing
dothis:
doingthis
## dothat : do that thing
dothat:
doingthat
.PHONY: clean
## clean : remove junk things
clean:
rm junkthings
Consulte a documentação com:
make
Por swcarpentry
all: dothis dothat
## dothis : do this thing
dothis:
doingthis
## dothat : do that thing
dothat:
doingthat
.PHONY: clean
## clean : remove junk things
clean:
rm junkthings
help : Makefile
@sed -n 's/^##//p' $<
Consulte a documentação com:
make help
Por marmelab
.DEFAULT_GOAL := help
all: dothis dothat
dothis: ## do this thing
doingthis
dothat: ## do that thing
doingthat
.PHONY: clean
clean: ## remove junk things
rm junkthings
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
Consulte a documentação com:
make
Por klmr
.DEFAULT_GOAL := help
all: dothis dothat
## dothis : do this thing
dothis:
doingthis
## dothat : do that thing
dothat:
doingthat
.PHONY: clean
## clean : remove junk things
clean:
rm junkthings
help:
@echo "$$(tput bold)Available rules:$$(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=29 -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";}'
Consulte a documentação com:
make