Skip to content

Instantly share code, notes, and snippets.

@killercup
Created January 13, 2017 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save killercup/f2a87adcbdb7bb97c03721c087b561a2 to your computer and use it in GitHub Desktop.
Save killercup/f2a87adcbdb7bb97c03721c087b561a2 to your computer and use it in GitHub Desktop.
Auto Makefile CLI help
ARGS = $(filter-out $@,$(MAKECMDGOALS))
MAKEFLAGS += --silent
PROJECTNAME = foobar
.PHONY: help
.DEFAULT_GOAL := help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
list:
help
####
# Actual targets
####
build: ## This is the documentation
echo "done."
####
# Argument fix workaround
###ä
%:
@:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment