[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using environmnet variables in make

From: albob
Subject: Re: Using environmnet variables in make
Date: Mon, 2 Mar 2009 03:46:14 -0800 (PST)

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
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
QA_STEP = start
export QA_STEP


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
     @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.
     @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,

View this message in context:
Sent from the Gnu - Make - Help mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]