A Makefile deploy
recipe needs an environment variable ENV
to be set to properly execute itself, whereas other recipes don't care, e.g.,
ENV =
.PHONY: deploy hello
deploy:
rsync . $(ENV).example.com:/var/www/myapp/
hello:
echo "I don't care about ENV, just saying hello!"
How can I make sure this ENV
variable is set? Is there a way to declare this makefile variable as a prerequisite of the deploy recipe? e.g.,
deploy: make-sure-ENV-variable-is-set
make
set it, or give a warning, or generate a fatal error? – Betamake ENV=dev
but if he forgets toENV=dev
,deploy
recipe will fail... – abernier