[jamming] Building Objects - Need to reference with grist when using them in another jam file?

Craig Allsop cjamallsop at gmail.com
Wed Dec 17 16:13:26 PST 2008


Hi.

On Wed, Dec 17, 2008 at 9:24 PM, Morgenthaler Björn
<bjoern.morgenthaler at comlet.de> wrote:
> Hi,
>
> I'm new to jam (using bjam without boost.build on windows xp) and am facing archive'ing a library from objects that are built in another jam file.

You don't need bjam, just get vanilla jam 2.5.

> So this works fine but is there a better way to reference the objects when archive'ing the lib? For example without the added grist (just like I archive the lib within the jam file the object is built)? I understand that the rule Objects adds those grists to provide a unique object and I do not want to lose this feature.

Yes. Use FGristFiles to add current location grist, i.e.

LibraryFromObjects component$(SUFLIB) : [ FGristFiles $(OBJS) ] ;

If those OBJS aren't in the current location then you could do it the
hard way...

SubDir TOP location of objs ;
OBJS = [ FGristFiles $(OBJS) ] ;
SubDir TOP here ;
LibraryFromObjects component$(SUFLIB) : $(OBJS) ;

But why don't you just put component1.lib in component1 directory
where it's files are? I.e.

component1/jamfile:

SubDir TOP component1 ;
SRC = [ Glob [ FDirName $(SUBDIR) src : *.c ] ; # scan for sources
SEARCH_SOURCE = src ; # tell jam to look here for them
Library component1 : $(SRC:BS) ; # build lib from srcs

Don't put a jamfile in 'src', just make a jamfile for each library.
SEARCH_SOURCE will tell jam to look in the 'src' sub folder for the
sources plus grist the sources for this library.

Craig.




More information about the jamming mailing list