Create a gist now

Instantly share code, notes, and snippets.

@adomokos /Makefile
Last active Mar 28, 2016

Makefile template
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:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(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