Re: [bbv2] creating a main rule and respectingexplicit

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [bbv2] creating a main rule and respectingexplicit

Renaud Lepère
> > I am trying to create a new top rule that work with the
> > explicit keyword. I tried the following code, but when
> > I call bjam i get "hello all". How can i do this ?
> >
> > rule mytest ( name )
> > {
> >     echo $(name) all ;
> > }
>
> This defined a rule (that is, function), that prints "$(name) all".
>
> > mytest hello ;
>
> This calls the above rule, which prints "hello all".
>
> What exactly are you trying to do? All main target rules work
> with "explicit"
> out of box, and it's impossible to write main target rule
> what would ignore
> "explicit".

I'm trying to make a specific install rule, and i want to call
this install rule in all my project.

rule my-install ( install-name : project-name )
{
    install $(install-name)-bin : $(project-name)        
                                : <location>../build/bin
                                : <install-type>SHARED_LIB ;
    install $(install-name)/lib : $(project-name)          
                                : <location>../build/lib
                                : <install-type>STATIC_LIB ;
}
..
and latter i want to write in my jamfiles

my-install install-abo : abo ;
explicit install-abo ;

>
> Have you read extender manual already? It's
> http://boost.org/boost-build2/doc/html/bbv2/extender.html and
> is the first
> think you should do before adding custom main target rules.

Thanks i will read this

Renaud

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: [bbv2] creating a main rule and respectingexplicit

Vladimir Prus
On Friday 03 February 2006 20:55, Renaud Lepere wrote:

> I'm trying to make a specific install rule, and i want to call
> this install rule in all my project.
>
> rule my-install ( install-name : project-name )
> {
>     install $(install-name)-bin : $(project-name)
>
>                                 : <location>../build/bin
>                                 : <install-type>SHARED_LIB ;
>
>     install $(install-name)/lib : $(project-name)
>
>                                 : <location>../build/lib
>                                 : <install-type>STATIC_LIB ;
>
> }

You can use this:

  install $(install-name)/bin : ........... ;
  explicit $(install-name)/bin ;

  alias $(install-name) : $(install-name)/bin ;

Then, using explicit in $(install-name) will have the usual effect. The code
you've shown above won't work since you don't define any target named
$(install-name).


HTH,
Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: [bbv2] creating a main rule and respectingexplicit

Renaud Lepère
In reply to this post by Renaud Lepère
> > I'm trying to make a specific install rule, and i want to call
> > this install rule in all my project.
> >
> > rule my-install ( install-name : project-name )
> > {
> >     install $(install-name)-bin : $(project-name)
> >     install $(install-name)/lib : $(project-name)
> > }
>
> You can use this:
>
>   install $(install-name)/bin : ........... ;
>   explicit $(install-name)/bin ;
>
>   alias $(install-name) : $(install-name)/bin ;
>
> Then, using explicit in $(install-name) will have the usual
> effect. The code
> you've shown above won't work since you don't define any target named
> $(install-name).
>

It is nearly ok ... but i still have a smammproblem, i have defined
rule myinstall ( install-name : project-name )
{
    install $(install-name)-bin : $(project-name) ...
    explicit $(install-name)-bin $(install-name)-lib ;
    alias $(install-name) : $(install-name)-bin $(install-name)-lib ;
}
in my jamfile and call myinstall rule in the same jamfile it is ok

myinstall install-abo : abo ;
explicit install-abo ;

but i defined myinstall rule in jamroot (to factorize it among other projects),
it does not work anymore and the installation is always done. Is there
an important thing i missed ?

Thanks
Renaud.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: [bbv2] creating a main rule and respectingexplicit

Vladimir Prus
On Monday 06 February 2006 17:28, Renaud Lepere wrote:

> It is nearly ok ... but i still have a smammproblem, i have defined
> rule myinstall ( install-name : project-name )
> {
>     install $(install-name)-bin : $(project-name) ...
>     explicit $(install-name)-bin $(install-name)-lib ;
>     alias $(install-name) : $(install-name)-bin $(install-name)-lib ;
> }
> in my jamfile and call myinstall rule in the same jamfile it is ok
>
> myinstall install-abo : abo ;
> explicit install-abo ;
>
> but i defined myinstall rule in jamroot (to factorize it among other
> projects), it does not work anymore and the installation is always done. Is
> there an important thing i missed ?

I'm afraid it's a bug. To work around it for now, go to build/project.jam,
locate rule 'explicit' near the end of the file and replace

   local t = [ project.target $(__name__) ] ;

with

   local t = [ project.current ] ;

This fix, and a test, are in CVS, so you can get it from there as well, when
the change appears in anon CVS.

- Volodya

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