Boost logo

Boost-Build :

Subject: Re: [Boost-build] Advanced generators, chaining them together...
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-19 20:19:29


AMDG

Alexander Sack wrote:
> 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

I don't see a good way to handle this. The problem is that
to fully automate this, you can't create the targets for the headers and
source files until you have updated file.cfg, right? bjam doesn't allow
new targets to be created after it begins updating targets.

In Christ,
Steven Watanabe


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