[jamming] Implicit action won't work

Chris Antos chrisant at windows.microsoft.com
Mon Feb 10 20:13:23 PST 2003


> I thought if rule HEX was executed, then action HEX would 
> *always* be executed too. It says here:
>   http://www.perforce.com/perforce/conf2001/wingerd/WPLaura.pdf
> ---------------------------------------------------------------
> 3.7 Implicity Invoked Actions
> When an action and a rule have the same name, Jam implicitly 
> invokes the action with the same arguments that were used in 
> the rule invocation.

It's true, if you take into account that the whole point of Jam or Make
or Nmake or etc is to define dependencies so that only the actions that
*need* to happen are actually executed.  It seems you interpreted the
section as saying "actions are always executed if a rule is executed",
but (a) I can't find where it says that [good, because it's not true
:-)] and (b) the point that section is trying to make is that "when an
action is executed, its arguments are the same as those used in the rule
invocation".

In your case, the problem is simple.  You never said that $(<) depends
on $(_h).  So de facto it does not.  :-)

   Depends all : $(_h) ;

You did say that "all" depends on $(_h), so at some point during Jam it
should in fact build the .hex file, but possibly not in time for it to
serve as an input to whatever actions are using.  "all" is a
pseudo-target; note that the statement above does not mean "make each
individual target depend on $(_h)".  Did you add that line just to
suppress the "independent target" warning that you'd otherwise get?

Here's the line you should be using instead:

   Depends $(<) : $(_h) ;




More information about the jamming mailing list