Subject: [Boost-build] Using an external pre-built object?
From: Ahmed Badran (ahmed.badran_at_[hidden])
Date: 2010-04-21 05:36:14
Is there a way in boost build to use an external pre-built object file
(.o on Unix) in a way that is analogous to the "lib" target?
I have a project that has quite a complicated directory structure and
build sequence dependencies and I decided to build one of these
directories using boost build, and I've been trying all sorts of
things that I've read and learned so far but it doesn't quite work
correctly, below is a representation of the problem:
+ Makefile that always invokes make in directory B first then in directory C
+ directory B
| + Makefile that produces foo.o here.
+ directory C
+ Makefile (very thin, just invokes bjam)
+ Jamroot that has a dependency on directory B/foo.o, and
let's say the target is bar
I tried having the following in the Jamroot file
alias foo : ../directoryB/foo.o
lib bar : ...<list all the sources> foo ;
This works fine as long as 'foo.o' exists in directory B before bjam
is invoked in directory C, now If I do a clean from the top level, the
foo.o file gets deleted first (due to the sequence in the top level
Makefile), then when bjam gets invoked in directory C it complains
about not finding the file ../directoryB/foo.o which makes sense since
it just got deleted by B's Makefile. All I really want to accomplish
is link this object in, even if the clean step would go and clean it
since it's in the sources, why is it complaining that it doesn't exist
when it will go and delete it anyway.
I have tried several different things and they all fail one way or the
other, I've tried using foo as a lib but that lead to the wrong link
command being invoked which makes sense. So is this possible in bjam
without having to replace the other makefiles by Jamfiles because that
would be quite a bit of work in of itself?
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