Boost logo

Boost-Build :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2006-04-21 01:08:39


Jorge Suit Perez Ronda wrote:
> ----
> bjam --version
> Boost.Build V2 (Milestone 10)
> Boost.Jam 03.01.10
> ----
>
> Hello, I have a project like this
>
> root
> |
> +- dir1
> |
> +- dir2
> |
> `- inc
>
> dir1 and dir2 contains .c source files and .h headers
>
> I want to create rule that create symbolic links to headers files in
> dir1 and dir2 into inc (only for unix)

There's a symlink target supported in BBv2, don't how operational it is
in BBv2M10, but it's been there a long time :-)

> I tried to do something like this:
>
> Jamfile at root/inc:
>
> ----
> import path ;
>
> rule header-link ( dirs * )
> {
> if ! $(NT)
> {
> for local d in $(dirs)
> {
> for local h in [ GLOB [ path.join $(GBLA_ROOT) $(d) ] : *.h ]
> {
> ECHO $(h) ;
> # here i want to 'ln -s $(h) .' ;
> }
> }
> }
> }
>
> header-link dir1 dir2 ;
> ----
>
> project-root.jam at root :
>
> ----
> path-constant GBLA_ROOT : . ;
>
> import toolset : using ;
> import gcc ;
> ----
>
> but I can not do something similar to:
>
> ln -s $(h) .
>
> Is there a way to do it?

Instead of all that you could, I think, do something like this:

import symlink ;
symlink : [ glob dir1/*.h dir2/*.h ] ;

In the Jamfile you need to put the symlinks in.

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

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