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