Skip to content

Instantly share code, notes, and snippets.

@afterdesign
Last active December 19, 2015 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afterdesign/6022954 to your computer and use it in GitHub Desktop.
Save afterdesign/6022954 to your computer and use it in GitHub Desktop.
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)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment