Boost logo

Boost-Build :

Subject: [Boost-build] Advanced generators, chaining them together...
From: Alexander Sack (pisymbol_at_[hidden])
Date: 2009-01-19 16:11:56


Hi Everybody,

I'm still trekking along converting our internal builds to use bjam to
evangelize the tool amongst the unaware! I've run across an
interesting build scenario. I have a build target that works like
using some custom GNUMake shell commands:

m4 file.m4 > file.cfg

(simple enough)

Then a custom tool is built (binary), call it foogen which is then
used to do the following:

foogen file.cfg s1.cc
foogen file.cfg s2.cc
foogen file.cfg s3.h

etc. etc.

Then those generated source files, s1.cc, s2.cc, s3.h etc. are ALL
used in the creation of a library. I was wondering is it worth trying
to make this a generator or at least two generators chained together?
I'm not sure how to go about this just yet. I thought I had something
then I realized it would still not work for what I have.

I've created some custom generators to do simple conversions but this
contains a level of indirection which complicates it a bit. What
makes it worst is that technically the tool will create ALL source
files from just doing:

foogen file.cfg
[a bunch of source files are produced, how to I tell boost-build that
when you run this you will produce a bunch of CPP/H files used for
compilation?]

I was thinking perhaps of just doing the m4 stuff manually (notfile
etc.) and then trying to use a generator for the file.cfg type so I
can just put that in my library statement (however if the m4 file
changes, then I need to full rebuild to pick it up).

Has anyone ran into this kind of build scenario before? Currently I
have this working with notfiles which is fine but really not much
better than the GNUMakefile shell commands we had before.

Any suggestions would be greatly appreciated,

-aps

PS Is there any example of this in the boost-build tree, I was digging
into tools/*.jam etc.


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