Boost logo

Boost-Build :

Subject: Re: [Boost-build] generate a relocatable module?
From: Vladimir Prus (ghost_at_[hidden])
Date: 2009-02-18 05:34:15

On Friday 13 February 2009 05:26:21 Laurent Morichetti wrote:
> How can I generate a relocatable module from object files (ld --relocatable) instead of an archive library?

There's no easy way presently.

> Or, is it possible to create an alias that containd the list of objects corresponding to the sources in a [ glob *.cpp ]?

I think the following should work:

        local objs ;
        for source in [ glob *.cpp ]
                objs += [ obj $(source:S=.obj) : $(source) ] ;
        alias all_objs : $(objs) ;

Note that the .obj suffix in the 'obj' rule does not actually affect the
generated filenames, it's only affecting the name of Boost.Build target,
and necessary so that if you have source main.cpp and target

        exe main : ...

the name of target used by the obj rule does not collide with 'main'.

Does this help?

- Volodya

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at