Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-11-14 05:57:35

David Abrahams wrote:

>>In other case, you should somehow guess the basename for generated
> It's this case for which I'd like an example.
>>For this, I require that all sources have the same name.
> Do you mean that there must be only one source file? Otherwise, how
> can they all have the same name? They're in different directories?

I mean, they should have the same basename. For example, a generator
comines target types X1 and X2 into Y. It's called with two targets.

1 (base)name : foo type : X1 properties : <foo>bar
2 (base)name : foo type : X2 properties :

Here, properties and, therefore, paths are different. But basename is
the same, so we're able to decuce the name for the generated target.

Some confusion arise because 'name' attribute of virtual-target actually
specified basename: withouth directory or suffix.

>>First version was taking name of sources as basename for generated targets.
>>I.e. gcc.compile, when taking a.cpp returns a.o. However, this is not enough.
>>In my example, asm.wd must be converted in asm_parser.whl and asm_lexer.dlp.
>>Name pattern is a was to achive that. Here's what I have for wd/whl/dlp:
>> generators.register-standard whale.wd : WD : WHL(%_parser) DLP(%_lexer) ;
>>The generator first finds basenames for sources, for example "asm". It then
>>notices that both generated targets have name patterns, and generates basenames
>>by replacing % in patterns with source basename. It given asm_parser and asm_lexer.
>>Suffixes for those targets are determined from their types, which gives
>>asm_parser.whl and asm_lexer.dlp.
> OK, I understand what it's doing now.
> I guess I'd rather do name generation with an overridable method in
> the generator; this strikes me as a feature many generators won't
> use. However, I could be wrong about that.

No need to make a decision right now. I'll note this point.
I'll also try to comment all this stuff today.

- Volodya


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at