The way around this is to *source* the script from the current
I'm sure there's an explaination for this in the unix FAQ. It's
a similar problem to why you can't write a shell script to change
to another directory and expect the parent shell to have changed
directories as well. (Sourcing the script or using an alias are
______ , _
(_) | /|/ \
| __ _ _ | | __, _ _ _ _|_
_ |/ \_/ |/ | | | | | | | / | |/ / |/ | |
(_/ \__/ | |_/ \_/|/ | |_/ \_/|_/\_/|/|__/ | |_/|_/
using bash-2.05, linux, make-3.79.1
I have a makefile which makes a program which runs in either serial mode or
parallel (multithread) mode, according to a flag I edit at the top
of the Makefile (the flag being the number of processes I want to run,
The make and compilation goes one way or another according to ifdefs etc.
WHen the program runs it needs to know from the environment, the number
of processes it's to run. So I need to export OMP_NUM_THREADS back to the
environment from which I called make.
The command "export" in a Makefile only passes an environmental variable to
I can't figure out how to get it back to the original environment.
I tried getting the Makefile to source a file ".profile" in the
same directory as the Makefile. I echo out the values, which are
correct when .profile is sourced, but the values aren't in the environment
when the Makefile executes.
Any ideas anyone?
Joseph Mack, NA3T, FM05lw EME(B,D)
AZ_PROJ map server at http://www.wm7d.net/azproj.shtml