Skip to content

Instantly share code, notes, and snippets.

@davesnx
Last active September 26, 2022 18:22
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davesnx/643af12dca2a7cfcd481fd3949b81f82 to your computer and use it in GitHub Desktop.
Save davesnx/643af12dca2a7cfcd481fd3949b81f82 to your computer and use it in GitHub Desktop.
Print other makefiles commands as help
.PHONY: help # Set default action to be help!
help:
@echo "List of available make commands";
@echo "";
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}';
@echo "";
# Add double ## comments on the same line as the dependencies and will be printed out when running help
# Don't add them if you don't want to appear on help!
##### Some placeholder actions #####
build: ## Build the project
@echo "build project"
clean: ## Clean the artifacts
@echo "clean"
test:
@echo "running tests..."
@echo "GREEN"
make
List of available make commands
build Build the project
clean Clean the artifacts
test Test the project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment