Skip to content

Instantly share code, notes, and snippets.

@hairyhum
Created May 11, 2016 11:13
Show Gist options
  • Save hairyhum/b95528d2c52b4ac43346cae570fc9c3b to your computer and use it in GitHub Desktop.
Save hairyhum/b95528d2c52b4ac43346cae570fc9c3b to your computer and use it in GitHub Desktop.
$ make foo
echo var /etc/init.d
var /etc/init.d
echo other /etc/init.d
other /etc/init.d
$ make bar
echo var /etc/init.d
var /etc/init.d
echo other /etc/init.d
other /etc/init.d
$ make foo VAR=woopwoop
echo var woopwoop
var woopwoop
echo other /etc/init.d
other /etc/init.d
$ make bar VAR=woopwoop
echo var ��q
var ��q
echo other /etc/init.d
other /etc/init.d
:~ make foo
echo var /etc/init.d
var /etc/init.d
echo other /etc/init.d
other /etc/init.d
:~ daniilfedotov$ make bar
echo var /etc/init.d
var /etc/init.d
echo other /etc/init.d
other /etc/init.d
:~ daniilfedotov$ make foo VAR=woopwoopwoop
echo var woopwoopwoop
var woopwoopwoop
echo other /etc/init.d
other /etc/init.d
:~ daniilfedotov$ make bar VAR=woopwoopwoop
echo var woopwoopwoop
var woopwoopwoop
echo other /etc/init.d
other /etc/init.d
OTHER_VAR=/etc/init.d
foo: VAR = $(OTHER_VAR)
foo:
echo var $(VAR)
echo other $(OTHER_VAR)
bar: VAR ?= $(OTHER_VAR)
bar:
echo var $(VAR)
echo other $(OTHER_VAR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment