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
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,
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
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
Description:
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
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.asc
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
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
$
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
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
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
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 the frame
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
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:
14 matches
Mail list logo