help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make381beta1


From: Markus Mauhart
Subject: Re: make381beta1
Date: Thu, 10 Feb 2005 02:10:58 +0100

"Paul D. Smith" <address@hidden> wrote ...
>
> OK, I fixed this.
> OK, I fixed this.
> OK, I fixed this.
> OK, I fixed this.

:)

>  mm> *) I think there is a bug w.r.t. target specific variables, at least my
>  mm> code doesnt work.
>
>  mm> If this is really a bug my guess is that the definition of the
>  mm> target-specific variable uses the "global variable database" instead
>  mm> of the "current DB" (which is used for the rule's targets and for
>  mm> its prerequisites).
>
> Hmm.  This is a tricky one.  I think it is a bug; can you submit it to
> the make bug tracker in Savannah so we don't lose track of it?

Ok, is submitted. Meanwhile I found a simple systematic workaround for it
in my current makefile: all such 'fuction parameters' are now passed using
local vars with a dumb name, but then immediately assigned to a global
var, which then is used inside this function [and all its sub-functions]:

define mkRuleForE
  e := $x
     #"e" must be well-known global variable,
     # and reliably NEVER local in our call-stack.
  $(warning Inside function mkRuleForE: e = $(e))
  .PHONY: $(e)Target
  all: $(e)Target
  $(e)Target: e := $(e)
  $(e)Target: ; @echo Making target $@ //"e" = "$(e)"
endef

...

$(foreach x,e2 e3,$(eval $(value mkRuleForE)))


Regards,
Markus.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]