[jamming] Jam2.5 and precompiled headers

Matt Armstrong matt at lickey.com
Wed Feb 12 09:46:25 PST 2003


"Chris Antos" <chrisant at windows.microsoft.com> writes:

> I simply took the path of least resistance to fix the problem, based
> on precedence that already existed in the stock Jambase.

Here is one argument in favor of your idea.

"a += b" is often taken as syntactic sugar for "a = a + b".

In the case of "on target" variables, we can expand += explicitly to
its "a = $(a) b ;" equivalent:

    rule FetchTargetVar
    {
        on $(1) return $($(2)) ;
    }

    VAR = global-value ;

    # Semantic equivalent to "VAR on t += value ;"
    VAR on t = [ FetchTargetVar t : VAR ] target-value ;

    ECHO "global VAR =" $(VAR) ;
    ECHO "VAR on t =" [ FetchTargetVar t : VAR ] ;

What does this print out?

    global VAR = global-value 
    VAR on t = global-value target-value 

The crux is that before variable a is set on a target, the value of "a
on target" is a's global value.  So there is a real argument for +=
behaving the way you want.


> Besides, you might find it illuminating to take a closer look at the
> exact values of for example $(HDRS) on targets.  Part of what
> originally sent me down this road was subtle cases where when I
> changed certain headers Jam didn't rebuild the right things.  After
> much debugging (and sifting through -d9 output) I finally realized
> it was due to the problem I've described.  HDRS on the target was
> not quite the right value, due to the ?= and += issue with the "on"
> keyword.

Yes, I submitted a bug fix for this last December, and Christopher
based his fix on mine.  I think the fix is in jam 2.5.


-- 
matt



More information about the jamming mailing list