Boost logo

Boost-Build :

Subject: Re: [Boost-build] using make rule in conjunction with target-os
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-05-29 05:25:21


On Saturday 29 May 2010 01:24:22 Rene Rivera wrote:

> On 5/28/2010 4:06 PM, Jim Gallagher wrote:
> >> It works for me.. I use it as:
> >>
> >> make icon.png : other/standard/iphone/icon.png
> >> : @image2icon :<configuration>standard<target-os>iphone ;
> >> make icon.png : other/limited/iphone/icon.png
> >> : @image2icon :<configuration>limited<target-os>iphone ;
> >>
> >> Which pays attention to both<configuration> (a custom feature I have)
> >> and<target-os> (only iPhone for this project but I have other that also
> >> include Windows).
> >>
> >> Perhaps it's the missing space before the<target-os>? Not sure if you
> >> have it that way in your actual files.
> >>
> >
> > It does appear that the spacing is not correct in the email. I double
> > checked the actual Jamfile, and there are spaces in the right places.
> > I wonder what I could have broken to cause this behavior?
>
> One difference I noticed of yours vs. mine is that I use the *same*
> target name (icon.png). Since variant selection happens on single target
> names it would explain why it works for me. If you reworked your use
> case so that is used the "install" rule instead. And adding the files as:
>
> install $(STAGE_SERVER)/bin : : :
> <target-os>windows:<source>script.bat
> <target-os>hpux:<source>script.sh
> ;
>
> It would work. The only way to keep it as you had it that I can see if
> is if you make no-op actions for the alternate cases. Which just make
> for a bunch more code:
>
> actions no-op { }
>
> make $(SCRIPT2) : script.bat : @common.copy : <target-os>windows ;
> make $(SCRIPT2) : script.bat : @no-op : <target-os>hpux ;
>
> But that would also likely cause it to always run the no-op actions
> since the targets would never be generated.

An alternative is:

 make $(SCRIPT2) : script.bat : @common.copy : <target-os>windows ;
 alias $(SCRIPT2) : : <target-os>hpux ;

Or, maybe even this:

        install script : : <target-os>windows:<source>script.bat
                                           <target-os>hpux:<source>script.sh
                       <location> $(STAGE_SERVER)/bin ;

Thanks,

--
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build: http://boost.org/boost-build2

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