Skip to content

Instantly share code, notes, and snippets.

@rochacbruno
Forked from hugoprudente/Makefile
Created February 25, 2021 21:52
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 rochacbruno/28636ce5cac15acf4c2f4ce07a6bd528 to your computer and use it in GitHub Desktop.
Save rochacbruno/28636ce5cac15acf4c2f4ce07a6bd528 to your computer and use it in GitHub Desktop.
Makefile with help
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-30s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
help:
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
image: secrets ## Build the container image.
docker build --file Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment