LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH
From the make info document, I understand that I must replace the
single $ with $$. Presumably, some additional quotes or backslashes
are required. Can anyone tell me what changes I need to make? Any
help or advice is greatly appreciated.
Thank you, Wendy Tucker / Symmetric Research
In article <19990818132138...@ngol05.aol.com>, W. Tucker wrote:
> When I execute these commands from the
> command line, everything works fine. But when I include them inside
> a makefile, the LD_LIBRARY_PATH does not get set properly. The exact
> command I am using inside the makefile is:
>
> LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH
At what stage do you want LD_LIBRARY_PATH to have an effect?
Each makefile rule is executed in a separate shell, and environment
variables are not propagated back from child to parent processes.
If your makefile causes some command like the above to be run,
that rule has no effect on subsequent rules.
Maybe you should change the command where LD_LIBRARY_PATH should
have an effect to
env LD_LIBRARY_PATH=$LD_LIBRARY_PATH my_command and its_arguments
where $LD_LIBRARY_PATH is set appropriately.
--
Paul Kimoto <kim...@lightlink.com>
Try
export LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
OR
LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} ; export $LD_LIBRARY_PATH
--
Dave Blake
dbl...@phy.ucsf.edu
Bzzzt. This is inside a makefile. As someone already said, each line
of a makefile rule is executed in its own shells, so setting a variable
in one does not affect another.
If you just want LD_LIBRARY_PATH in one rule, use backslashes (\) to
end lines so that you effectively get one rule line:
target: $(TARGET_DEPENDS)
LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) export LD_LIBRARY_PATH \
do_one_command;\
do_another_command;\
do_yet_another;
It's cumbersome for large rules. If on the other hand you want to set
LD_LIBRARY_PATH for the whole makefile, you can set LD_LIBRARY_PATH as
a make variable and then declare the phony target .EXPORT_ALL_VARIABLES
(I think this is a GNU make extension).
--
Peter Samuelson
<sampo.creighton.edu!psamuels>