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
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
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
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
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
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
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
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
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
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
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
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
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
___
Consider a Makefile that starts thus:
include ../../../Makefile-master
It would be nice if this included Makefile-master knew where it was, so it could do
stuff like this:
root := $(MAKEFILE-PARENT-DIR)
classesDir := $(root)/classes
I use this unsatisfactory workaround:
Makef
14 matches
Mail list logo