Boost logo

Boost-Build :

Subject: [Boost-build] How to build an external library using a makefile.
From: Alex Richardson (alexrichardson_at_[hidden])
Date: 2008-11-20 10:34:51


I am still very new to boost build, so this question is probably
rather trivial. I have a project using a boost.build Jamfile. My
project needs to use a 3rd party library. From the documentation I
found that I could use a standard lib target declaration, with a
<file> statement:

lib mythirdpartylib : : <file>third-party-lib.a ;

This works fine as long as that library has already been built, but
this library is available in source form, with a gnu makefile. I would
really like to run that makefile to build the library when needed. I
looked at some of the documentation on custom make rules, and came up
with a naive solution along the lines of:

make third-party-lib.flag : : @makelib ;
actions makelib
{
    ( cd $(LIBPATH) && make )
    touch $(<)
}

lib mythirdpartylib : third-party-lib.flag : <file>third-party-lib.a ;

Unfortunately, the mythirdpartylib target fails because
'third-party-lib.a' does not exist. (It won't exist until after the
'makelib' action was run). It appears that the my
"third-party-lib.flag" target does not get built before it evaluates
the <file> statement.

Is there a good/standard way to use 'makefile' based libraries from a Jamfile?

Thanks

Alex


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk