Boost logo

Boost-Build :

Subject: Re: [Boost-build] how do I create a new bjam target?
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-03-11 07:13:34


Marak Laszlo wrote:
> Dear Boost.build experts,
>
> I have a problem with bjam, that has been troubling me for a week. I would
> like to add a new compiler support to bjam. This compiler returns the same
> object file as gcc (compatible). Now, I have declared a rule called
>
> rule my-rule ( name : source ) ...
> ...
>
> and somewhere in it there is a
>
> NOTFILE $(name:G=e) ;
> do-nothing $(name:G=e) : $(so) ;
>
>
> when I call the rule in the jamfile
>
> my-rule npink : src/some_src.cpp
>
> nothing happens.

What is happening here is that your rule tries to declare bjam targets,
like $(name:G=e). However, when you have:

        exe a : a.cpp ;

this does not create any bjam targets at all. Rather, it creates a metatarget,
and only after Jamfiles are parsed, the metatarget is generated to create
bjam targets.

Did you read the extender's manual? I think the easiest way to do what you
want is something like:

        import feature ;
        feature.extends toolset : yougcc ;
        
        import generators ;
        generators.register $(__name__).compile : OBJ : CPP : <toolset>yourgcc ;

and then, in Jamfile, have this:

        obj a : a.cpp : <toolset>yourgcc ;

This is untested code, but should be mostly right. Does this help?

- Volodya


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