Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2002-11-14 08:10:53

Vladimir Prus <ghost_at_[hidden]> writes:

> 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 :

I assume you mean
1 basename: foo, type: X1, properties: <foo>bar
2 basename: foo, type: X2, properties:

Maybe you should avoid putting spaces before colons. In the context of
Jam it can be a little bit confusing (like 10 minutes' worth!)

> Here, properties and, therefore, paths are different.

Do you mean that _subvariant_ paths are different? Since the target
type gets into the properties, I assume that's enough to cause
different subvariant paths...

> 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.

So why not call it basename?

>>>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.


David Abrahams
dave_at_[hidden] *
Boost support, enhancements, training, and commercial distribution

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