Boost logo

Boost-Build :

From: zouguangxian (zouguangxian_at_[hidden])
Date: 2005-10-07 23:58:36


hi all,
I have write a dog.jam to define "dog" rule, this rule was used
to convert .dll to .dog, following is the dog.jam , you can see that
I use copy instead of convert in actions dog . In fact,
the "convert" is a exe target in the project.
My question is how to write jamfile, so that the target in dog
rule will depend on the target "convert" ?

----------dog.jam------

import type ;
import generators ;
import "class" : is-a new ;

type.register DOG : dog ;
generators.register-standard dog.dog : SHARED_LIB : DOG ;

actions dog
{
echo $(.CC) ;
copy $(>) $(<) ;
}

class dog-generator : generator
{
rule __init__ ( * : * : * )
{
generator.__init__ $(1) : $(2) : $(3) : $(4) :
$(5) : $(6) : $(7) : $(8) : $(9) ;
}

rule run ( project name ? : property-set : sources * )
{
local converted ;
if ! [ type.is-derived [ $(sources[1]).type ] LIB ]
{
local result ;
result += [ generators.construct
$(project) $(name)
: LIB : $(property-set) :
$(sources) ] ;
converted = $(result[2]) ;
}
else
{
converted = $(sources[1]) ;
}

if $(converted) && [ $(converted).type ] =
SHARED_LIB
{
local result ;
result = [ generators.construct
$(project) $(name)
: DOG : $(property-set) :
$(converted) ] ;
return $(result[2-]) ;
}
}
}

generators.override dog.dog-generator : dog.dog ;
generators.register [ new dog-generator dog.dog-generator : : DOG ] ;

 


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