ngmachado
October 23rd, 2008, 12:17 PM
Hi all,
I bet this one is easy... but not for me.
I want to change the current PATH variable in a makefile.
For instance:
$ echo $PATH
/usr/bin:/usr/sbin
$ PATH=$PATH:/my/dir
$ echo $PATH
/usr/bin:/usr/sbin:/my/dir
After I quit, the /my/dir will be lost but... no problem!
Now I wanna replicate this behaviour in a makefile, I tried the following code but it didn't work:
test:
PATH=$(PATH):/my/dir
If I run it, I get:
$ make test
PATH=/usr/bin:/usr/sbin:/my/dir
$ echo $PATH
/usr/bin:/usr/sbin
Any help will be greatly appreciated. Thanks.
I bet this one is easy... but not for me.
I want to change the current PATH variable in a makefile.
For instance:
$ echo $PATH
/usr/bin:/usr/sbin
$ PATH=$PATH:/my/dir
$ echo $PATH
/usr/bin:/usr/sbin:/my/dir
After I quit, the /my/dir will be lost but... no problem!
Now I wanna replicate this behaviour in a makefile, I tried the following code but it didn't work:
test:
PATH=$(PATH):/my/dir
If I run it, I get:
$ make test
PATH=/usr/bin:/usr/sbin:/my/dir
$ echo $PATH
/usr/bin:/usr/sbin
Any help will be greatly appreciated. Thanks.