WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit 1d9ab77

Browse files
author
nickg
committed
make self-documenting makefile
1 parent f10ccd0 commit 1d9ab77

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ docker-console: ## log into the test image
7272
cp -f scripts/commit-msg.sh .git/hooks/commit-msg
7373
hooks: .git/hooks/pre-commit .git/hooks/commit-msg ## install git precommit hooks
7474

75-
# Absolutely awesome: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
75+
.PHONY: help ci console docker-build bench
76+
77+
# https://www.client9.com/self-documenting-makefiles/
7678
help:
77-
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
79+
@awk -F ':|##' '/^[^\t].+?:.*?##/ {\
80+
printf "\033[36m%-30s\033[0m %s\n", $$1, $$NF \
81+
}' $(MAKEFILE_LIST)
82+
.DEFAULT_GOAL=help
83+
.PHONY=help
7884

79-
.PHONY: help ci console docker-build bench

0 commit comments

Comments
 (0)