[Cook] implicit rules and variables

Peter Miller peterm at platypus.net
Tue Jun 25 09:07:12 EST 2002


Fredrick Paul Eisele writes...
> The following example is in the user's guide...
> 
> %.c %.h: %.y
>     set match-mode-cook
> {
>     yacc -d %.y;
>     mv yy.tab.c  %.c;
>     mv yy.tab.h  %h;
> }
> 
> What I want to know is if this ...
> 
> why = '%.y';
> 
> %.c %.h: [why]
>     set match-mode-cook
> {
>     yacc -d %.y;
>     mv yy.tab.c  %.c;
>     mv yy.tab.h  %h;
> }
> 
> ... is equivalent?

No.

Inside the recipe bodies of implicit recipes, string literals which
contain percent signs (%) get expanded.  Variables contents are
unaltered.  Use the subst function to substitute into variables, eg
	[subst %% % [why]]

Regards
Peter Miller <millerp at canb.auug.org.au>
/\/\*        http://www.canb.auug.org.au/~millerp/ 



More information about the Cook-users mailing list