BTW, I also said that such a variable can be overwritten by the included makefile.  I 
think it has a pretty high probability of being overwritten and the probability 
increases the more makefiles are included.  For example, adding to the example below:

# foo.make
p := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
include another.make
$(warning $p)

# another.make
p := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
include one-more.make
$(warning $p)

How are you going to guarantee that the names of the variables are unique?  Do you 
still think that MAKEFILE_LIST is a scalable, viable solution?

Noel

Boris Kolpackov wrote:

Noel Yap <[EMAIL PROTECTED]> writes:


Try:

$ cat >bar.make
include foo.make
$(warning $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))))


You gotta be kidding me!

p := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
include foo.make
$(warning $p)



_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make

Reply via email to