$ cat Makefile
all:
echo VAR is ${HOME}
echo VAR is $${HOME}
Gives
$ make
echo VAR is /home/abc
VAR is /home/abc
echo VAR is ${HOME}
VAR is /home/abc
Why does echo VAR is ${HOME}
syntax work in Makefile? I thought, to use shell variables you have to use $${HOME}}
Yes and no. It is best to use
$$
to be explicit. However, there is a special rule for environment variables: