On Thu, 2011-07-28 at 09:50 -0400, Martin d'Anjou wrote:
> I can't figure out how to pass the parent stem value to a prerequisite
> rule:
> 
> .SECONDEXPANSION:
> rule_%: test=foo
> rule_%: parent_stem=$*
> rule_%: child_b
>   @echo in parent: parent_stem=$(parent_stem)
> 
> child_%:
>   @echo in child: stem=$*
>   @echo in child: test=$(test)
>   @echo 'in child: parent_stem=$(parent_stem) --> this should be "a",
> not "b"'

I'm not at all sure this can be made to work, because automatic
variables are defined in the context of the command script for the rule
only (see the docs), but if it has any chance to work you MUST use an
escaped "$" in the parent_stem setting:

        rule_%: parent_stem=$$*

(again see the docs for .SECONDEXPANSION)


_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to