Boost logo

Boost-Build :

Subject: [Boost-build] Generating C file from C file
From: Nogradi, Chris (Chris.Nogradi_at_[hidden])
Date: 2011-02-24 17:40:05


I am attempting to generate a C file from another C file and then create a library from the generated sources (~2000 files). I tried this and it causes bjam to use massive amounts of memory and time:

type.register GEN_C : : C ;

generators.register-standard gen.generate : C : GEN_C(GEN_%) ;

rule generate ( targets * : sources * : properties * )
{
}

actions generate
{
    "gen_c.py" -f $(>) -o $(<)
}

rule gen_lib ( main-target-name : sources + : requirements * : default-build * : usage-requirements * )
{
    for local file in $(sources)
    {
        gen-c $(file:B) : $(file) ;
        files += $( file:B) ;
    }
    lib $(main-target-name) : $(files) : $(requirements) <implicit-dependency>$(files:B) : $(default-build) : $(usage-requirements) ;
}

gen_lib lib : [ glob *.c ] ;

There is obviously a better solution. Can someone suggest what to do here? I looked at the custom generator example in the manual and I am not sure it will do what I want. Can someone confirm that custom generators are the right choice here? Will this solve the memory and time problem?

Thanks,

Chris

________________________________
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.

Thank you for your cooperation.



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