[jamming] locals not local

Alen Ladavac alenl-ml at croteam.com
Wed Aug 8 22:18:07 PDT 2007


Hi Craig,

The syntax for "on" is: "<var> on <target> = <expression> ;". Notice
that the var's value is set on a _target_ not on another var. Perhaps
you ment to do something like this?:

rule A
{
  local here = sometarget;
  x on $(here) = in-a ;
}

Which effectively sets the value of "x" on a pseudo-target named
"sometarget".

etc...

Btw, for pseudo-targets targets, I find it simpler to use a variable
that includes a target's name than to set a variable on the target.
E.g. instead of

FAKED on $(project) = 1 ;

I'd do

$(project)-FAKED = 1 ;

Which is then easily read by $($(project)-FAKED) . The "on" syntax is
more suitable when used in actions. But it's a matter of taste.

HTH,
Alen



Craig wrote:

> Hi jammers,

> It would seem that local var ; does not include that variable's "on"
> settings. I wonder if there is a reason it doesn't? Anyone?

> SubDir TOP ;

> rule A
> {
>         local here ;
>         x on here = in-a ;
> }

> rule B
> {
>         local here ;
>         x on here = in-b ;
>         A ;
>         on here echo $(x) ;
> }

> x on here = nowhere ;
> B ;
> on here echo $(x) ;

> outputs...
> in-a
> in-a
> ...found 8 targets(s)...

> Craig.
> _______________________________________________
> jamming mailing list  -  jamming at perforce.com
> http://maillist.perforce.com/mailman/listinfo/jamming





More information about the jamming mailing list