Re: need access to Makefile path

2004-05-18 Thread Noel Yap
Try: $ cat >bar.make include foo.make $(warning $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST Noel Boris Kolpackov wrote: Noel Yap <[EMAIL PROTECTED]> writes: Unless MAKEFILE_LIST is used before any other includes, using the trick below doesn't work. $ cat >makefile include foo.make

Re: need access to Makefile path

2004-05-18 Thread Boris Kolpackov
Noel Yap <[EMAIL PROTECTED]> writes: > >>How are you going to guarantee that the names of the variables are unique? > > > >You could use variable framing ;-) > > What's variable framing? You can say $(call frame-enter) include foo.make $(call frame-leave) and any changes to variables inside

Re: need access to Makefile path

2004-05-18 Thread Noel Yap
Boris Kolpackov wrote: Noel Yap <[EMAIL PROTECTED]> writes: How are you going to guarantee that the names of the variables are unique? You could use variable framing ;-) What's variable framing? Do you still think that MAKEFILE_LIST is a scalable, viable solution? It is good enough to bootstrap

Re: need access to Makefile path

2004-05-18 Thread Noel Yap
Boris Kolpackov wrote: One thing I can say right now is, if you had an include-makefile function, the below would become: $(call include-makefile,foo.make) # frame-enter and frame-leave are implicit Well, when you include a makefile you would probably want it's variable definitions too so I am

Re: need access to Makefile path

2004-05-18 Thread Noel Yap
Although it's reminiscent of DOS, I like your use of '%' in private variable names. There's a lot of meat in this. It'll take some time for me to chew on it and digest. One thing I can say right now is, if you had an include-makefile function, the below would become: $(call include-makefi

Re: need access to Makefile path

2004-05-18 Thread Boris Kolpackov
Noel Yap <[EMAIL PROTECTED]> writes: > Unless MAKEFILE_LIST is used before any other includes, using the trick > below doesn't work. $ cat >makefile include foo.make include $(CURDIR)/bar.make $ cat >foo.make $ cat >bar.make $(warning $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST

Re: need access to Makefile path

2004-05-18 Thread Noel Yap
Unless MAKEFILE_LIST is used before any other includes, using the trick below doesn't work. I think it's also quite messy to have to create explicitly a variable to hold this information in each makefile that needs it. Moreover, there's no guarantee that someone won't overwrite the variable in w

Re: need access to Makefile path

2004-05-18 Thread Boris Kolpackov
Noel Yap <[EMAIL PROTECTED]> writes: > How are you going to guarantee that the names of the variables are unique? You could use variable framing ;-) > Do you still think that MAKEFILE_LIST is a scalable, viable solution? It is good enough to bootstrap and build on top. -boris signature.a

Re: need access to Makefile path

2004-05-18 Thread Boris Kolpackov
Noel Yap <[EMAIL PROTECTED]> writes: > Although it's reminiscent of DOS, I like your use of '%' in private > variable names. They are called "system variables". > One thing I can say right now is, if you had an include-makefile function, > the below would become: > > $(call include-ma

Re: need access to Makefile path

2004-05-18 Thread Boris Kolpackov
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) signature.asc Descr

Re: need access to Makefile path

2004-05-18 Thread Noel Yap
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 $(MAKEFI

Re: need access to Makefile path

2004-05-18 Thread Noel Yap
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) Like I said

Re: need access to Makefile path

2004-05-18 Thread Boris Kolpackov
Dave Yost <[EMAIL PROTECTED]> writes: > Consider a Makefile that starts thus: > > include ../../../Makefile-master > > It would be nice if this included Makefile-master knew where it was, $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -boris ___