Last active
March 10, 2020 16:38
-
-
Save b3cft/6e5d10ae195629d36b5d9cc8f36fb925 to your computer and use it in GitHub Desktop.
Makefile automagic help
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL=bash | |
.DEFAULT=help | |
ifndef VERBOSE | |
.SILENT: | |
endif | |
# Colours | |
NO_COLOUR=\033[0m | |
OK_COLOUR=\033[1;32m | |
INFO_COLOUR=\033[1;33m | |
SECTION_COLOUR=\033[1;37m | |
ERROR_COLOUR=\033[1;35m | |
WARN_COLOUR=\033[0;33m | |
help:: | |
awk 'BEGIN {FS = ":.*##";} /^[a-zA-Z0-9_-]+:.*?##/ { printf " $(INFO_COLOUR)%-20s$(NO_COLOUR) %s\n", $$1, $$2 } /^##@/ { printf "\n$(SECTION_COLOUR)%s$(NO_COLOUR)\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | |
##@ Grouping one | |
target1: ## Description of target 1 | |
target2: ## Description of target 2 | |
##@ Grouping two | |
target3: ## Description of target 3 | |
target4: ## Description of target 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment