Paul Smith-20 wrote:
> 
> You're absolutely right, of course; in the case quoted above it's better
> to do it your way, _but_ IFF <do-something> is a single command.  If
> it's a longer script where QA_STEP is needed in multiple commands, you'd
> need to export separately still.
> 

Hi all,
     Firstly thanks for all your help in this. I am getting a much better
understanding of how make actually works (sub-shells etc). Is below a fair
summary?
1) If I need the environment variable visable to all sub-shells of my make
file I need to do the exprt externally to the sub-shells
i.e.
QA_STEP = start
export QA_STEP

test:
   <do_something>

2) If it is only (and must only be) visible to a particular task in the make
file I export it on the same line as the sub-process which needs to see it
test:
     @QA_STEP=start; export QA_STEP; <do-something>

3) (An extension of 2 above) If within the task in the make file there are
multiple commands which need to see the variable I need to have the export
for each command ie.
 test:
     @QA_STEP=start; export QA_STEP; <do-something>
     @QA_STEP=start; export QA_STEP; <do-something-else>

Also as an aside, what is the purpose of the "@" at the start of the lines?

Again many thanks,
                        Alan



-- 
View this message in context: 
http://www.nabble.com/Using-environmnet-variables-in-make-tp22229241p22286646.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to