List Info

Thread: main-target-rule




main-target-rule
country flaguser name
United States
2007-03-21 02:24:43
I'm looking at the implementation of main-target-rule and I
see:

    # This rule may be only called from Jamfile, and
therefore, 
    # CALLER_MODULE is Jamfile module, which is used to
denote 
    # a project.
    local project = [ project.current ] ;

I sure hope that this rule doesn't rely on being called from
a
Jamfile, as I need to declare targets in python.jam.  I'm
sure it's a
fairly common kind of need, too.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: main-target-rule
country flaguser name
Russian Federation
2007-03-21 06:12:36
On Wednesday 21 March 2007 10:24, David Abrahams wrote:
> 
> I'm looking at the implementation of main-target-rule
and I see:
> 
>     # This rule may be only called from Jamfile, and
therefore, 
>     # CALLER_MODULE is Jamfile module, which is used to
denote 
>     # a project.
>     local project = [ project.current ] ;
> 
> I sure hope that this rule doesn't rely on being called
from a
> Jamfile, as I need to declare targets in python.jam. 
I'm sure it's a
> fairly common kind of need, too.

That comment is out-of-date; as you see, CALLER_MODULE is
not being used.

The most reliable way to declare targets outside of Jamfiles
is
this:

	project python ;
	.project = [ project.current ] ;

	rule whatever-rule-wants-to-declare-targets ( ) 
	{
		    project.push-current $(.project) ;
	
			... declare targets ...

     		    project.pop-current ;
	}

This will always declare targets in the python project, even
if you
have multiple "using python" and between those
"using" some
other python is declared.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: main-target-rule
country flaguser name
United States
2007-03-21 09:48:19
on Wed Mar 21 2007, Vladimir Prus <ghost-AT-cs.msu.su>
wrote:

> On Wednesday 21 March 2007 10:24, David Abrahams
wrote:
>> 
>> I'm looking at the implementation of
main-target-rule and I see:
>> 
>>     # This rule may be only called from Jamfile,
and therefore, 
>>     # CALLER_MODULE is Jamfile module, which is
used to denote 
>>     # a project.
>>     local project = [ project.current ] ;
>> 
>> I sure hope that this rule doesn't rely on being
called from a
>> Jamfile, as I need to declare targets in
python.jam.  I'm sure it's a
>> fairly common kind of need, too.
>
> That comment is out-of-date; as you see, CALLER_MODULE
is
> not being used.

OK; will you update it?

> The most reliable way to declare targets outside of
Jamfiles is
> this:
>
> 	project python ;
> 	.project = [ project.current ] ;
>
> 	rule whatever-rule-wants-to-declare-targets ( ) 
> 	{
> 		    project.push-current $(.project) ;
> 	
> 			... declare targets ...
>
>      		    project.pop-current ;
> 	}
>
> This will always declare targets in the python project,
even if you
> have multiple "using python" and between
those "using" some
> other python is declared.

Thanks.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )