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.
Hmm... 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? /Lasse >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On >Behalf Of ext anonymous >Sent: Saturday, July 26, 2008 08:44 >To: Icarus Sparry; Martin Dorey; [EMAIL PROTECTED]; >[EMAIL PROTECTED]; bug-make@gnu.org >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 >Bug-make@gnu.org >http://lists.gnu.org/mailman/listinfo/bug-make > _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make