Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Using $HOME inside Makefile

>Hi all,
>Can't seem to get this right. I have a Makefile with:
>        cp backup $HOME/bin
>        @echo 'Setting executable status...'
>        chmod 750 $HOME/bin/backup
>I don't want to use /home/mikel/bin as then the Makefile is
>not generic.
>Whats the really simple stuff I have forgotten. (man make
>says nothing about using environment vars inside Makefile)

You have to escape the $ as $$ so that make doesn't try to expand it as
a make variable and it actually gets to the shell.