Boost logo

Boost-Build :

From: Ilya Sokolov (fal_delivery_at_[hidden])
Date: 2006-06-23 02:38:57


Sohail Somani wrote:
>>-----Original Message-----
>>From: boost-build-bounces_at_[hidden]
>>[mailto:boost-build-bounces_at_[hidden]] On Behalf Of Ilya Sokolov
>>
>>>__object__ files that were inputs into the linker for
>>
>>targets a and b?
>>
>>as i understand, you need this:
>>[snip very good suggestions]
>
>
> Ok, so I lied (sorry)... Its more like this:
>
> lib a : [ glob a/*.cpp ] ;
> lib b : [ glob b/*.cpp ] ;
> lib c : [ glob c/*.cpp ] b ; # c needs b
>
> lib all : a b c ;
>

local a_cpp = [ glob a/*.cpp ] ;
for local i in $(a_cpp)
{
   # :B for basename, see "jam/language/variables"
   obj $(i:B) : $(i) ;
}
lib a : $(a_cpp:B) ;

local b_cpp = [ glob b/*.cpp ] ;
for local i in $(b_cpp)
{
   obj $(i:B) : $(i) ;
}
lib b : $(b_cpp:B) ;

local c_cpp = [ glob c/*.cpp ] ;
for local i in $(c_cpp)
{
   obj $(i:B) : $(i) ;
}
lib c : $(c_cpp:B) $(b_cpp:B) ;

lib all : $(a_cpp:B) $(b_cpp:B) $(c_cpp:B) ;

you can also move the loops to separate rule:

rule objs ( name
           : sources ? # maybe i wrong with this signs, see docs
           : requirements *
           : default-build ?
           : usage-requirements )
{
   for local i in $(sources)
   {
     obj $(i:B) : $(i) ;
   }
}


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