[jamming] how jam handles LinkLibrary and SubInclude ?

Ingo Weinhold bonefish at cs.tu-berlin.de
Sun Jul 23 09:14:01 PDT 2006


On 2006-07-23 at 09:59:23 [+0200], Groleo Marius <groleo at gmail.com> wrote:
> On 7/23/06, John Waugh <john.waugh at gmail.com> wrote:
> > The only solution for this that I found was to make a new rule, such as 
> > this
> > one:
[...]
> > It basically sets a flag to make sure the "SubInclude" only happens once,
> > and thus your code only gets built once.
> 
> But why would anyone would want SubInclude to build the allready builded
> file ? What's the point here ?

The point is that you can attach more than one action to a target. The 
actions are executed in order of their addition. Including the Jamfile twice 
causes all actions therein to be attached twice.

I suppose the only reason for you to include lib/dir1 in lib/dir2 is that 
you want to be able to cd into lib/dir2 and jam there. The Haiku project 
(http://developer.berlios.de/projects/haiku/) has a slightly modified jam 
version (http://svn.berlios.de/viewcvs/haiku/buildtools/trunk/jam/) that 
does always parse the whole Jamfile tree of the project. Since it creates 
the dependencies to the pseudotargets (all, lib, exe, files, obj,...) only 
for the targets defined in descendant dirs of the working directory jam has 
been invoked from, a "jam all" in a subdirectory still works as expected 
with the improvement that all of the project's target are known and all 
dependencies are updated correctly too.

CU, Ingo

PS: You don't need to set TOP. The first SubDir does that for you. It is 
necessary to set TOP only in case one of your tools needs absolute paths. 
And then you set the TOP as an environment var outside of jam.


More information about the jamming mailing list