I wanted to use Makefile like this:
make deploy env=production
to get this:
0.0.0.0
:= is initializind variable when something is accesing it.
| SHELL := bash | |
| environment := $(shell echo $(env) | tr a-z A-Z) | |
| PRODUCTION_HOST = 0.0.0.0 | |
| TESTING_HOST = 1.1.1.1 | |
| rsync_or_smth = \ | |
| echo $($(environment)_HOST) | |
| deploy: | |
| @$(call rsync_or_smth) |