[jamming] Compiling the same file with different flags for different targets

Craig Allsop cjamallsop at gmail.com
Thu Dec 4 16:25:37 PST 2008


OR

SOURCE_GRIST is used to distinguish between different versions of the
same source but different flags/options. LOCATE_TARGET is used to
place the different versions with the same names into different output
directories and avoid conflict.

Just set them in a scope for each Main so that jam knows that there
are two versions of lib.o with different flags. Jam has a rule
ObjectCcFlags for setting flags. You can put it one jamfile if you
desire...

SubDir TOP blah blah blah ;

{
  local SOURCE_GRIST = $(SOURCE_GRIST) static ;
  local LOCATE_TARGET = $(LOCATE_TARGET) static ;
  Main test1 : test1.c lib.c ;
}

{
  local SOURCE_GRIST = $(SOURCE_GRIST) shared ;
  local LOCATE_TARGET = $(LOCATE_TARGET) shared ;
  Main libtest.so : lib.c ;
  ObjectCcFlags lib.c : -fPIC ;
  LINKFLAGS on libtest.so = -shared ;
}

Next you'll want debug and release configurations too, it's all more
of the same really. Stick it all in a loop and call it for every
different combination so you can build all the flavours at the same
time.

Craig.


On Tue, Dec 2, 2008 at 12:14 PM, warkda rrior
<announcements.for.warkdarrior at gmail.com> wrote:
> Hi,



More information about the jamming mailing list