Last active
March 20, 2024 07:05
-
-
Save auxiliumknowledge/607d6ceb37c6a4e8fa3cb255555243e3 to your computer and use it in GitHub Desktop.
Display a help output for included makefiles too
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
# Improved from the Symfony Conf example | |
help: ## This comment creates ouput | |
@grep -E '(^[a-zA-Z_]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | sed 's/[^:]*\(:.*\)/\1/' | cut -c 1 --complement | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/' | |
build: ## Build your application | |
include submakefile | |
# --- Example output --- | |
# --- include files are always appended --- | |
# help This comment creates ouput | |
# build Build your application | |
# test Run all tests |
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
test: ## Run all tests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment