make-w32
[Top][All Lists]
Advanced

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

Re: Allow SHELL to include variables and functions.


From: Paul Smith
Subject: Re: Allow SHELL to include variables and functions.
Date: Thu, 11 Oct 2007 01:10:30 -0400

On Wed, 2007-10-10 at 21:00 +0200, Eli Zaretskii wrote:
> > Second, I don't quite get how this works; it seems to me that you're
> > expanding the value when the variable is defined (where things like $@
> > etc. are not set yet) and then storing the expanded variable...?
> 
> Yes, that's true.  But I think that things like $@ will get evaluated
> when the command
> 
>      $(SHELL) -c whatever
> 
> is run by Make, because at that time all the variables present in the
> command line are expanded, right?

Well yes, but it looks to me like you're expanding the value of SHELL
when it's defined (aren't you?)... so that would mean when make reads
in:

        SHELL = $($w [$@ ($^) ($?)])$(OLD_SHELL)

won't the code you've added expand it right there, as part of the
do_variable_define()?  Or is the expansion somehow deferred until the
rule is invoked?

And if it's expanded right here then won't the automatic variables like
$@, $^, and $? not be set yet?

I feel like I'm definitely missing something.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.us
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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