Skip to content

Commit

Permalink
make self-documenting makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed May 30, 2017
1 parent f10ccd0 commit 1d9ab77
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ docker-console: ## log into the test image
cp -f scripts/commit-msg.sh .git/hooks/commit-msg
hooks: .git/hooks/pre-commit .git/hooks/commit-msg ## install git precommit hooks

# Absolutely awesome: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY: help ci console docker-build bench

# https://www.client9.com/self-documenting-makefiles/
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@awk -F ':|##' '/^[^\t].+?:.*?##/ {\
printf "\033[36m%-30s\033[0m %s\n", $$1, $$NF \
}' $(MAKEFILE_LIST)
.DEFAULT_GOAL=help
.PHONY=help

.PHONY: help ci console docker-build bench

0 comments on commit 1d9ab77

Please sign in to comment.