[jamming] Jam2.5 and precompiled headers

Matt Armstrong matt at lickey.com
Tue Feb 11 22:45:53 PST 2003

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

> Anyway, the central fix is enough to solve the root of the problem,
> although you won't be able to use my Jambase as-is.  It will need an
> extra line before anyplace that I used the "VAR on $(x) += $(y)"
> syntax:
> VAR on $(x) ?= $(VAR) ;
> That will copy the global value of $(VAR) into the "VAR on $(x)"
> first, if "VAR on $(x)" has not yet been populated.  Otherwise the
> initial "+=" will merely set the new target-specific value and
> obscure the global value, thus not doing what the rule writer
> intuitively expects.  Without the central fix, the "?=" line above
> won't work properly.
> My private version's "+=" automatically copies the global value
> first if appropriate, at least until someone can show me an example
> where it would not be the Right Thing to do.

That's an interesting.  I never thought about this because I've never
written a rule that would depend on the behavior of "on <target> +="
either way.  I usually keep the names used for target variables
distinct from global variables.

After thinking about it though, the behavior of your jam does not
conform to my personal principle of least surprise.  I think of the
"on target" variables as living in a separate namespace, and would
consider automatic "pollution" of this namespace an unexpected event.


More information about the jamming mailing list