Boost logo

Boost-Build :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2007-09-06 07:52:24


On 09/05/07 14:34, Larry Evans wrote:
> On 09/05/07 14:19, Vladimir Prus wrote:
[snip]
>>> rule glib ( name )
>>> {
>>> obj $(name)_obj : $(name).cpp ;
>>> }
>>> glib test
>>> ;
>>>
>>> However, I got:
>>>
>>> bjam --v2 test
>>> gcc.jam:init-link-flags:toolset,condition= gcc , <toolset>gcc-4.1
>>> gcc.jam:init-link-flags:toolset,condition= gcc , <toolset>gcc-4.3_v
>>> notice: could not find main target test
>>> notice: assuming it's a name of file to create
>> You have defined rule (which is basically a function in jam-speak)
>> that calls the 'obj' rule. The obj rule is called with 'test_obj' as
>> the name, and create main target called 'test_obj'. There's no target
>> called 'test' declared.
>>
>> Just calling a function does not automatically creates a main target.
>> There are just two ways to create a main target:
>>
>> - Call the targets.main-target-alternative
>> - Call some existing rule that creates main target. That will
>> will eventually call targets.main-target-alternative
>>
>> HTH,
>
> Yes, thanks. I'd assumed from just the glib example that
>
> glib xxx ;
>
> in the Jamfile.v2 would create xxx target. Don't you read the example
> that way?

After changing the body of glib rule to:

     obj $(name) : $(name).cpp ;

, which is closer to what the glib example had, it worked.
I'd assumed that:

   obj $(name)_obj : $(name).cpp

satisfied:

>> - Call some existing rule that creates main target. That will

but, apparently, the argument to the calling rule (i.e. glib) must be
the same as the argument to some existing rule that creates a main target.

Sorry for noise.


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