List Info

Thread: how to install multiple targets built with genrb?




how to install multiple targets built with genrb?
user name
2006-12-20 18:59:18
I'm using
     Boost.Build V2 (Milestone 11)
     Boost.Jam 03.1.13
on linux, fc6, gcc 4.1.1, 32bit intel.

install works for a single target, i.e. this builds in
bin/gcc/...
and installs the binary in the appropriate bin.

------ snip ---------
install dist : hello :
      
<variant>release:<location>$(OUTDIR)/release/bin
      
<variant>debug:<location>$(OUTDIR)/debug/bin ;

exe hello : hello.cpp ;
------ snip ---------

how to do for something that builds multiple targets?  I
have a main 
rule to build .res files from .txt using genrb (the icu
resource compiler).

in res.jam:

------ snip ---------
type.register RES : res ;
type.register TXT : txt ;

generators.register-standard res.resource : TXT : RES ;

actions resource
{
     genrb "-d$(<)"
"$(>)"
}
------ snip ---------

in Jamroot:
------ snip ---------
import res ;

rule genrb ( sources + : requirements * )
{
     for local r in $(sources)
     {
         res $(r:B) : $(r) ;
     }
}
------ snip ---------

now in the resource file source directory the Jamfile is
simple:

genrb [ glob *.txt ] ;  # this is the only line in it

this compiles the resources, one for each *.txt file, into 
./bin/gcc/debug, ./bin/gcc/release, etc.

I would like to be able to do something like
install dist : magic :
      
<variant>release:<location>$(OUTDIR)/release/res
      
<variant>debug:<location>$(OUTDIR)/debug/res
       ;

where, obviously, magic will not work.  I *could* just list
all the .txt 
files individually and build and install them one by one
using the "res" 
rule and a corresponding install rule, but that's painful.

would it be possible to make the genrb rule return a list of
the install 
locations somehow and (somehow) use that to do the installs?
 or I could 
loop over the *.txt files and call res and install inside
the loop, but 
again makes an ugly Jamfile that ends up cut/paste in every
res directory.

what I'd like is something that concentrates the complex
stuff in one or 
two files and is simple to use in the individual Jamfiles
(as the genrb 
rule is already...but it doesn't do enough).

any suggestions?

thx
dxc
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
how to install multiple targets built with genrb?
user name
2006-12-20 19:56:13
On Wednesday 20 December 2006 21:59, david x callaway wrote:

> rule genrb ( sources + : requirements * )
> {
>      for local r in $(sources)
>      {
>          res $(r:B) : $(r) ;
>      }
> }

> genrb [ glob *.txt ] ;  # this is the only line in it
> 
> this compiles the resources, one for each *.txt file,
into 
> ./bin/gcc/debug, ./bin/gcc/release, etc.
> 
> I would like to be able to do something like
> install dist : magic :
......
> what I'd like is something that concentrates the
complex stuff in one or 
> two files and is simple to use in the individual
Jamfiles (as the genrb 
> rule is already...but it doesn't do enough).

It's 23:00 here so I might be talking rubbish, but I thin
that:

 rule genrb ( sources + : requirements * )
 { 
      local result ;
      for local r in $(sources)
      {
          res $(r:B) : $(r) ;
          result += $(r:B) ;
      }
       return $(result) ;
 }

should work. The 'res' rule define main target named $(r:B),
if you add
the name of a main target to the sources list of 'install'
that main target
gets installed.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
how to install multiple targets built with genrb?
user name
2006-12-20 20:30:42
yes!  using your genrb rule below I can write, in the
resource directory 
Jamfile

reslist = [ genrb [ glob *.txt ] ] ;

install dist : $(reslist) :
      
<variant>release:<location>$(OUTDIR)/release/res
      
<variant>debug:<location>$(OUTDIR)/debug/res;

and the compiled resource files end up where I want them.

I tried something similar by simulating it manually, and it
didn't work. 
  I think the trick (after getting the rule to return the
paths) is the 
[ ] to make it into a list.

note I was pleasantly surprised to find that spaces in
OUTDIR were not a 
problem.

thanks!
dxc

Vladimir Prus wrote:
> On Wednesday 20 December 2006 21:59, david x callaway
wrote:
> 
>> rule genrb ( sources + : requirements * )
>> {
>>      for local r in $(sources)
>>      {
>>          res $(r:B) : $(r) ;
>>      }
>> }
> 
>> genrb [ glob *.txt ] ;  # this is the only line in
it
>>
>> this compiles the resources, one for each *.txt
file, into 
>> ./bin/gcc/debug, ./bin/gcc/release, etc.
>>
>> I would like to be able to do something like
>> install dist : magic :
> ......
>> what I'd like is something that concentrates the
complex stuff in one or 
>> two files and is simple to use in the individual
Jamfiles (as the genrb 
>> rule is already...but it doesn't do enough).
> 
> It's 23:00 here so I might be talking rubbish, but I
thin that:
> 
>  rule genrb ( sources + : requirements * )
>  { 
>       local result ;
>       for local r in $(sources)
>       {
>           res $(r:B) : $(r) ;
>           result += $(r:B) ;
>       }
>        return $(result) ;
>  }
> 
> should work. The 'res' rule define main target named
$(r:B), if you add
> the name of a main target to the sources list of
'install' that main target
> gets installed.
> 
> - Volodya
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
> 
> 
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
[1-3]

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