From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-02-01 09:21:25
> I am trying to migrate a make-based build system to bbv2 and reached a
> point from where I don't quite know how to proceed:
> Assume, I have some source files a.src and b.src. Invoking a converter with
> all of the source files as input (i.e. "my_converter --flags
> -doutput_directory a.src b.src") generates header and C-files a.h, a.c, b.h
> and b.c in output_directory. From these an exe is built.
> Is it possible to define a generator to be able to say in my Jamfile:
> lib mylib : src.cpp ;
> exe myprog : a.src b.src mylib ;
No, unfortunately it's not possible, it's not clear how to implement this. We
obvious can't run your generator will all possible subsets of input files.
Is there any reason why running your tool once for each .src file is not
If that's not feasible, you can create your own target type, say
"MY_CONVERTED_CPP", derived from CPP. Then you can define a custom generator
for your type, and:
- mark the generator as 'composing'
- make the generator produce a pair of target for each source
Then, Jamfile will look like:
lib mylib : src.cpp ;
exe myprog : my_processed mylib ;
my_converted_cpp my_processes : a.src b.src ;
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