Last active
February 18, 2020 00:21
-
-
Save adomokos/2fd95840d59b19bbb3f4 to your computer and use it in GitHub Desktop.
Makefile template
This file contains hidden or 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
DBUSER=db_user | |
DBPASSWD=db_password | |
DBNAME=some_db | |
THIS_FILE := $(lastword $(MAKEFILE_LIST)) | |
.DEFAULT_GOAL := help | |
build-db: ## Builds the DB | |
dropdb --if-exists --username $(DBUSER) $(DBNAME) | |
createdb --username $(DBUSER) $(DBNAME) | |
.PHONY: help | |
help: ## Prints this help command | |
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) |\ | |
sort | \ | |
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment