[jamming] Announcing XJam 2.5

Craig Allsop cjamallsop at gmail.com
Sun Jun 15 19:11:01 PDT 2008


Hi Richard,

Yes you could, but a couple of reasons why we don't do that...

1. For those people building on one singe/dual/quad core machine
perhaps that is fine. But when you use a larger number of jobs, say
-j15 or more there will be a stall of jobs between your jam
invocations. However, if you do them all at the same time jam can be
compiling the next executable's source whilst it is linking the
previous one. Add to that, you may want to build debug, release and
retail of 3 platforms too...

In this case you'd want to "UseModule" on more than one platform at
the same time. Stock jam requires very little changes to facilitate
this. You just need to set the approprate variables for each variant
before calling Main. So how I do this is by another Main (this is a
simplified version to demonstrate the point):

rule Main2
{
  PLATFORMS = pc ps3 ps3spu xbox ;
  TYPES = debug release retail ;
  for p in $(PLATFORMS)
  {
     for t in $(TYPES)
     {
        # set appropriate variables for this combination here
        Main $(<) : $(>) ;
     }
  }
}

Of course you need a method of determining which variant you're
building. You could use grist but we choose instead a simple suffix
that includes platform and type, e.g. _xd might mean xbox debug. So I
can build my variants specifically like so:

jam Game_xr Game_xd Game_xf Game_pr Game_pd Game_pf Game_r Game_d Game_f

Of course a sane person would have made some handy pseudo targets.

2. You might want to embed some data that you build on your host (e.g.
pc) into your target executable (e.g. playstation). You could run jam
to build the data, then run it again to build the executable. Why not
do both, I mean perhaps all you want to do is say:

jam Game_playstation_debug

And the executable is dependent on the embedded data so jam will build
the pc tool with vc compiler/tools, that builds the data, that
generates a .c, that is compiled using gcc into .o, that is linked to
your target executable.

Just food for thought.

Craig.

ps. By the way, there was a post not long ago to fix a problem whereby
if you pass several targets on the command line stock jam will treat
them as if you did call jam each time.


On Mon, Jun 16, 2008 at 11:11 AM, Richard Mitton <mitton at treyarch.com> wrote:
> Well I guess you'd just call jam 4 times with a different parameter, and
> just include the appropriate module each time.


More information about the jamming mailing list