[Top][All Lists]

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

RE: [bug #23928] Add MAKEFILE variable

From: lasse.makholm
Subject: RE: [bug #23928] Add MAKEFILE variable
Date: Mon, 28 Jul 2008 13:01:22 +0300

Philip Guenther wrote:
>BTW, $(lastword ${MAKEFILE_LIST}) is _not_ always the makefile 
>being parsed
>at that moment, particularly when there's an 'include' 
>directive earlier in
>the makefile.  There's in fact no 100% general and reliable 
>way to get the
>name of the file that's being parsed.


Wouldn't MAKEFILE_LIST be more useful if it always contained the list of
makefiles that lead from the top makefile to the current one?

E.g. given makefiles A, B, C and D. If A includes B and B includes D and
then C. Then MAKEFILE_LIST would contain:

"A"     when parsing A,
"A B"   when parsing B,
"A B C" when parsing C and
"A B D" when parsing D

Wouldn't that make more sense? 


>-----Original Message-----
>From: address@hidden 
>[mailto:address@hidden On 
>Behalf Of ext anonymous
>Sent: Saturday, July 26, 2008 08:44
>To: Icarus Sparry; Martin Dorey; address@hidden; 
>address@hidden; address@hidden
>Subject: [bug #23928] Add MAKEFILE variable
>Follow-up Comment #3, bug #23928 (project make):
>Icarus Sparry wrote:
>> You probably want lastword, rather than firstword.
>Nope.  To quote the original request:
>> It is often useful to recursively call the current makefile
>> as part of a rule. Sometimes rules are included from a
>> different file. The included file may not know the name of
>> the make file used to start the make process.
>The request was for the name of "the make file used to start the make
>process", which would be $(firstword ${MAKEFILE_LIST}).
>(The use of the phrase "current makefile" is slightly 
>ambiguous, but I think
>the last sentence makes it clear that it is meant to refer to 
>the makefile
>that started the whole deal.)

>    _______________________________________________________
>Reply to this item at:
>  <http://savannah.gnu.org/bugs/?23928>
>  Message sent via/by Savannah
>  http://savannah.gnu.org/
>Bug-make mailing list

reply via email to

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