Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-08-13 19:12:39


Paul Hamilton <paul_at_[hidden]> writes:

> I have a need to generate header files which are then subsequently
> used in a source file and built.
>
> If i have a file called "xxx.y", which is used as an input to a
> program to generate "xxx.hpp", and "xxx.hpp" is included in "xxx.cpp"
> I should (I thought) be able to do something like this:
>
> rule Tangle
> {
> DEPENDS $(<) : $(>) ;
> }
>
> actions Tangle
> {
> tanglemyfile $(<) $(>)
> }
>
> Tangle xxx.hpp : xxx.y ;
>
> CPP_SOURCES = xxx.cpp ;
>
> lib mylib : $(CPP_SOURCES).cpp
> : <sysinclude>$(PROJECT_ROOT) <sysinclude>$(BOOST_ROOT)
> : debug release
> ;
>
> But when I try all of this in my jamfile, as much as I touch xxx.y,
> xxx.hpp is never being asked to rebuild. basically the "actions" is
> never executed.

That's because there's no dependency chain from the Jam target
associated with mylib to the jam target called "xxx.hpp". The actual
Jam target names generated by Boost.Build use grist, so you can't
identify "xxx.hpp" quite that easily.

> What's the right way to do this?

You need to get your action integrated with the Boost.Build system.
There are existing rules in the system for handling yacc files; you
might look at those for guidance. Don't be misled the classic Jam
rules from the Jambase documentation.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk