I was thinking about this a little more.  At first, I requested that the path to
the included makefile reflect that path used to include that makefile.  I now
think that this path should reflect the relative path to the primary makefile.
For example, in the following:
# contents of Makefile
include asdf/asdf.mk

Makefile.out:
     @echo $(MAKEFILE)

# contents of asdf/asdf.mk
include asdf-1.mk

asdf.out:
     @echo $(MAKEFILE)

# contents of asdf/asdf-1.mk

asdf-1.out:
     @echo $(MAKEFILE)

the output of "make -Iasdf asdf-1.out" should be:
Makefile asdf/asdf.mk asdf/asdf-1.mk

not:
Makefile asdf/asdf.mk asdf-1.mk

Noel




[EMAIL PROTECTED] on 2000.08.17 00:37:40

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:   [EMAIL PROTECTED]
Subject:  Re: RFC: MAKEFILE macro




%% "Noel L Yap" <[EMAIL PROTECTED]> writes:

  >> would give confusing answers.  I'll think about this.  You might
  >> consider submitting an RFE to the bug tracking system.

  nly> A possibly more general thing to do might be to keep the include
  nly> stack within MAKEFILE.  One should be able to get the current
  nly> makefile with $(firstword $(MAKEFILE)).  Anyway, just another
  nly> consideration.

This is closer to what I was thinking.  Although, I think they should
come in the order they were read, not in reverse order.  Then the first
one is always the "main" makefile, and the last one is always the
current makefile.  Both are easy to get using functions.  So far I've
had a number of requests for things like this but yours is the first one
that's wanted the name of the makefile currently being parsed, as
opposed to the top level.

  nly> How would I submit an RFE?

The URL for the online bug database is available in the GNU make README
file.  I also have a link on my site below.

Actually, I notice there's already an RFE for something similar (PR/1446).

--
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist







This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan & Co. Incorporated, its
subsidiaries and affiliates.

Reply via email to