Boost logo

Boost-Build :

Subject: [Boost-build] Generator with incrementally built output file
From: João Luís Pinto (joaoluispinto_at_[hidden])
Date: 2011-07-11 06:00:59


Hello,

I'm trying to implement a generator that requires that the output
(single) file is built incrementally by processing the one or more
input sources. Something that would (as a concept and in a simplified
way) look like this:

import generators ;
import "class" : new ;

type.register SNIP : snip ;

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

    rule run ( project name ? : property-set : sources * )
    {
        local a ;

        for local s in $(sources)
        {
            a += [ new action $(s) : snip.process : $(property-set) ] ;
        }

        local t = [ new file-target $(name) : RC : $(project) : $(a) ] ;

        return $(t) ;
    }
}

generators.register [ new snip-generator snip.snip : SNIP : CPP ] ;

actions process
{
    cat $(>) >> $(<)
}

But the file-target cannot be built with a set of actions, and I
haven't managed to understand a way to have several actions associated
with the several input files outputting to a single output file that
is not regenerated every time a single individual action is performed.

Any thoughts?

Thank you

JLP


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