[jamming] [WARNING : A/V UNSCANNABLE] Re: how jam handles LinkLibrary and SubInclude ?

Kai Backman kaib at google.com
Mon Jul 24 09:47:45 PDT 2006


Hi Groleo,

 I took a stab at your project files and pruned away a few things and
now jam doesn't build double sets of files. Here are some general
comments:

- You don't need to set TOP, jam does that for you
- The second subinclude in dir2 is what causes the problem, you need
to drop it or use the code John provided. In the first case you need to
build
from the project root (which is what you tried to avoid).

 I think the problem you are running into is that SubInclude and SubDir are
just a pieces of standard Jam script. They set certain global variables and
rely on a certain order of execution. I agree that with current machines it
would
probably make more sense to source the whole project tree, instead of just
the Jamfile tree routed at the directory where you currently are. I use
a compile macro in the editor specifically to invoke jam only from the same
directory as the Jamrules file is in. You can either use that or grab the
changes Ingo mentions.

 As for updated version, yes, I would love them too .. :-)

 Take care,

 Kai


On 7/23/06, Groleo Marius <groleo at gmail.com> wrote:
>
> Hi,
>
> Hi. I have the following directory structure:
> --------------------------
> Jamfile  Jamrules  lib  main.cpp
> groleo at cucu:~/test/lib$ ls -lR
> .:
> total 8
> drwxr-xr-x 2 groleo groleo 4096 2006-07-23 01:09 dir1
> drwxr-xr-x 2 groleo groleo 4096 2006-07-23 01:09 dir2
>
> ./dir1:
> total 16
> -rw-r--r-- 1 groleo groleo  73 2006-07-23 01:01 dir1.cpp
> -rw-r--r-- 1 groleo groleo 157 2006-07-23 01:05 Jamfile
> -rw-r--r-- 1 groleo groleo  84 2006-07-23 01:01 prot.h
> -rw-r--r-- 1 groleo groleo 169 2006-07-23 01:07 t_dir1.cpp
>
> ./dir2:
> total 16
> -rw-r--r-- 1 groleo groleo  73 2006-07-23 01:01 dir2.cpp
> -rw-r--r-- 1 groleo groleo 191 2006-07-23 01:03 Jamfile
> -rw-r--r-- 1 groleo groleo  84 2006-07-23 01:01 prot.h
> -rw-r--r-- 1 groleo groleo 214 2006-07-23 01:07 t_dir2.cpp
>
> If I run jam, in the TOPDIR, then the library gets builded
> each time a jamfile is sourced via SubInclude:
> ------------------
> LINUX
> Linux BUILD
> ...found 92 target(s)...
> ...updating 10 target(s)...
> C++ lib/dir1/dir1.o
> C++ lib/dir1/dir1.o
> Archive lib/dir1/libdir1.a
> ar: creating lib/dir1/libdir1.a
> Ranlib lib/dir1/libdir1.a
> C++ lib/dir2/dir2.o
> Archive lib/dir2/libdir2.a
> ar: creating lib/dir2/libdir2.a
> Ranlib lib/dir2/libdir2.a
> C++ main.o
> Link main
> Chmod1 main
> C++ lib/dir1/t_dir1.o
> C++ lib/dir1/t_dir1.o
> Link lib/dir1/t_dir1
> Chmod1 lib/dir1/t_dir1
> Link lib/dir1/t_dir1
> Chmod1 lib/dir1/t_dir1
> C++ lib/dir2/t_dir2.o
> Link lib/dir2/t_dir2
> Chmod1 lib/dir2/t_dir2
> ...updated 10 target(s)...
> -----------------------
>
>
> How can i tell Jam to build each object/target only once ?
>
> I have attached a directory structure simmilar to one I use in a project.
>
> --
> Regards, Groleo!
>
>
> _______________________________________________
> jamming mailing list  -  jamming at perforce.com
> http://maillist.perforce.com/mailman/listinfo/jamming
>
>
>
>


-- 
Kai Backman, Software Engineer, kaib at google.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://maillist.perforce.com/pipermail/jamming/attachments/20060724/07ad9551/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arch2.tar
Type: application/x-tar
Size: 20480 bytes
Desc: not available
Url : http://maillist.perforce.com/pipermail/jamming/attachments/20060724/07ad9551/arch2.tar


More information about the jamming mailing list