Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-11-15 02:47:24


Hi Sara,
> Hi, I've just started using bjam and have a question
> regarding to stage rule.
>
> For example,
> (1) stage dist : hello helpers ;
> (2) stage dist : hello helpers : <location>/usr/bin ;
>
> If (1) causes the hello and helpers target to /dist
> directory, can't we just have this for (2)? Why
> bother using <location>?

Good question!

> stage /usr/bin : hello helpers ;
>
> Also, in (2), eventhough "dist" is defined there, it's
> actually not used for anything?

In the example, it's not. However, you can have:

alias install : install-bin install-lib ;
stage install-bin : .........
stage install-lib : .........

in which case the main target name is referred to by another target.

Named stage rule can be also explicitly requested by the user:

bjam dist

> The only place I found the use of <location> is when
> you want to have the output to go to different
> directories for different toolsets.
> stage dist : hello helpers
>
> : <toolset>gcc:<location>gcc
>
> <toolset>msvc:<location>msvc ;
>
> Is there any other use for <location>?

Another possible use is where location is computed dynamically, say:

local prefix = [ MATCH --prefix=(.*) : [ modules.peek : ARGV ] ] ;
stage dist : .... : <location>$(prefix)/bin ;

> And also, is there a way to have something like
> stage dist : hello helpers
>
> : <toolset>gcc:<variant>debug:<location>gcc/debug
>
> <toolset>gcc:<variant>release:<location>gcc/release ;

Yes, please see:

http://boost.org/boost-build2/doc/html/bbv2/reference/definitions.html#bbv2.reference.variants.propcond

for the right syntax. (BTW, that section was not included in TOC due to markup
error, which I'll fix right now)

> And lastly, is there a way to force the compiler to
> put all obj and exe files in a specified directory
> instead of the default bin/toolset-name/variant/...?

No, not directly. You can only stage them all. BTW, if using one directory,
how would you deal with build variants?

- Volodya

 


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