Boost logo

Boost-Build :

From: Eric Niebler (eric_at_[hidden])
Date: 2006-09-29 13:35:12

David Abrahams wrote:
> "Eric Niebler" <eric_at_[hidden]> writes:
>> So, test-suite is not a target, and explicit only works on targets.
>> Fine.

I take that back, I don't think that's fine. If "explicit" only works on
targets, shouldn't it be an error to use it with something that isn't a
target? With a useful error, like "blah-ext is not a target"?

>> But what makes test-suite not a target? How can I tell based on
>> the syntax of:
>> test-suite blah : [ blarg.cpp ] ;
>> that test-suite is not a target? Syntactically, it looks a lot like
>> things which are targets, right?
> No, that looks like a rule invocation (a.k.a. function call). Whether
> a rule invocation creates a target or not, and what that target is
> called, is totally up to the implementation of the rule.

Oh. So rules are like functions that modify global state (the "targets,"
for example)? And the global state is implicit; that is, there is no
explicitly declared variable that holds the targets. Or is there?

And I would need to look at the documentation for that rule to determine
if it creates a target, right? FWIW, I can't find where the test-suite
rule is documented. I didn't look hard; did I overlooked it?

>> Why are they (targets, aliases for targets) syntactically identical
>> if they don't behave alike?
>> Again, sorry if that's a stupid question.
> Not stupid at all; systems like make would lead you to believe that
> was a target declaration. bjam doesn't syntactically distinguish
> target declaration from other activities.

Ah! That helps -- no doubt that's where my bias comes from.

But if my characterization above is accurate (functions modifying
implicit global state), then I'm beginning to understand why I have such
a hard time with BBv2.

Thanks for taking the time to explain this.

Eric Niebler
Boost Consulting

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