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.)


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.


Philip Guenther


    _______________________________________________________

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

Reply via email to