Boost logo

Boost-Build :

From: Vas Crabb (vcrabb_at_[hidden])
Date: 2008-03-03 23:54:18


Khassapov, Alex <Alex.Khassapov <at> itg.com> writes:

>
>
>
>
>
> I wonder how to generate multiple cpp files from one text
> file? Rule ‘make’ takes only one target.
>
> When I use
>
>
>
> alias genearted : $(ListOfFiles) ;
>
> make generated : $(source) : <at> somerule ;
>
>
>
> I get an error:
>
>
>
> error: No best alternative for ./generated
>
> next alternative: required properties:
> (empty)
>
> matched
>
> next alternative: required properties:
> (empty)
>
> matched
>
>
>
>
>
> Best Regards
>
> Alex Khassapov
>

Hi,

I'd like to be able to do something like this in a simple manner, too. I can't
find a way to make BJam realise that it's supposed to build multiple targets
with arbitrary names from sources. It's trivial to do with make. Here's an
example of how I could do something similar with make:

GENERATED = \
        gen1.txt \
        gen2.txt \
        gen3.txt \
        gen4.txt \
        gen5.txt

$(GENERATED) : src1.txt src2.txt src3.txt
        some_command $(foreach src,$^,-s $(src))

Is there any way to do something like this with BJam? Maybe with a custom
generator?

Vas


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