Boost logo

Boost-Build :

From: Phillip Seaver (phil_at_[hidden])
Date: 2008-06-25 13:06:32


I've got a program, bin2c.c, for embedding files in executables by
creating a C file containing the input file as a byte array. I'm trying
to create a module that will have a rule that runs bin2c to generate the
C file. I also want the module to compile the executable to be used.

So, I created bin2c.jam and put it (along with bin2c.c) in
boost-build/contrib. When I try to use it with "bin2c profiles : [ glob
*.icc ] ;", I get errors:

> src/misc/boost-build/build\generators.jam:841: in try-one-generator-really
> *** argument error
> * rule object(linking-generator)@25.run ( project name ? :
> property-set : sources + )
> * called with: ( object(project-target)@192 bin2c_exe :
> object(property-set)@862 : )
> * missing argument sources
> src/misc/boost-build/tools\builtin.jam:726:see definition of rule
> 'run' being called
> src/misc/boost-build/build\generators.jam:902: in try-one-generator
> src/misc/boost-build/build\generators.jam:1113: in construct-really
> src/misc/boost-build/build\generators.jam:1185: in generators.construct
> src/misc/boost-build/build\targets.jam:1429: in construct
> src/misc/boost-build/build\targets.jam:1242: in
> object(typed-target)@195.generate
> src/misc/boost-build/build\targets.jam:772: in generate-really
> src/misc/boost-build/build\targets.jam:744: in
> object(main-target)@841.generate
> src/misc/boost-build/build\targets.jam:891: in
> targets.generate-from-reference
> src/misc/boost-build/build\targets.jam:1167: in generate-dependencies
> src/misc/boost-build/build\targets.jam:1216: in
> object(make-target-class)@198.generate
> src/misc/boost-build/build\targets.jam:772: in generate-really
> src/misc/boost-build/build\targets.jam:744: in
> object(main-target)@842.generate
> src/misc/boost-build\build-system.jam:668: in load
> src\misc\boost-build/kernel\modules.jam:281: in import
> src\misc\boost-build/kernel/bootstrap.jam:128: in boost-build
> src\boost-build.jam:1: in module scope

Here is my bin2c.jam that I'm using with "using bin2c ;":

rule init ( )
{
    if ! $(.initialized) {
        .initialized = true ;
        exe bin2c_exe : [ GLOB bin2c.c ] : <variant>release
<threading>single ;
    }
    IMPORT $(__name__) : bin2c : : bin2c ;
}
rule bin2c ( target : source + )
{
    return [ make $(target) : bin2c_exe $(source) : bin2c_run ] ;
}
actions bin2c_run
{
    "$(>[1])" "$(>[2-])" "$(<)"
}

I feel like I'm probably missing something relatively obvious, but I've
been working on this for a few hours, and I haven't been able to get it yet.

Thanks,

Phillip


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