Thank you very much for the prompt replies, they were very useful.
In the end (for the time being!), I am using patchelf. I couldn't find a
way to configure Bash with RPATH (I still haven't stopped searching, but
I need to progress for now).
It is interesting that exported variables are not set in `$(shell ...)'.
But I am a little confused, because I also export `PATH' and `CPPFLAGS'
and many other basic flags, but I could see them in `$(shell printenv)'!
Your points about a generic setting of LD_LIBRARY_PATH in the Makefile
is indeed correct, and I completely understand it. My usage scenario is
a little non-standard/different.
In summary, it is a project aiming to make a fully reproducible paper:
trying to tackle the reproducibility crisis in the sciences. A complete
description of it is available here:
https://gitlab.com/makhlaghi/reproducible-paper/blob/pipeline/README-pipeline.md
As you see, the whole thing (even the analysis of a research project) is
managed in Make.
Since many scientific projects (at least in astrophysics: my field) use
large clusters or super computers for processing very large datasets, I
cannot assume root access.
In summary it builds almost all the necessary tools, does the analysis
using those tools, and creates the final LaTeX-compiled PDF paper.
Since many scientists use Mac OS (unfortunately!), it also needs to work
on those operating systems. So it just doesn't build the C compiler and
linker, but builds almost everything on top of that (its like a
mini-package-manager!).
I hope this shows why its necessary to fully re-write PATH,
LD_LIBRARY_PATH and other basic environment variables within Make, so
the processing for each project is as independent of the host operating
system as possible (and thus reproducible, or fully under control on
different systems).
By the way, in case you have any thoughts/points regarding this
"reproducible paper" project, they would be most highly appreciated and
welcome.
Thanks again for all the great points,
Cheers,
Mohammad
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make