3 messages in com.perforce.jamming[jamming] Auto generated files
FromSent OnAttachments
Richard Smith20 Feb 2002 10:06 
Matt Armstrong20 Feb 2002 11:35 
Diane Holt20 Feb 2002 17:59 
Subject:[jamming] Auto generated files
From:Matt Armstrong (ma@lickey.com)
Date:02/20/2002 11:35:59 AM
List:com.perforce.jamming

Richard Smith <rich@ex-parrot.com> writes:

[...]

When I run Jam the first time it builds foo.cc correctly but it doesn't know that it needs to build foo.h before compiling it, and so fails. If I re-run Jam, it is able to analyse the included files in foo.cc and it then builds foo.h and compiles and links foo happily.

Is there a way of getting this to work?

Once actions start running (and, say, build your foo.cc) there is no way to modify the dependency information. For jam to build something in one run, it needs the complete dependency tree before it starts building anything. There is no way to scan foo.cc for headers after Jam has just built it.

( I do not want to just add a "Depends $(1) : first ;" line to the AutoHeader rule. )

I wouldn't do that either.

Since foo.cc is generated, presumably the header files it will depend up on are known ahead of time. You could add "Depends foo.cc : foo.h" in there yourself. You might be able to wrap the messy details in the rules that generate foo.cc. This is kindof yucky, since you're inserting more knowledge about how foo.cc is generated into the Jam rules than you might like, but doing stuff like this is the only way to get it to work with Jam.