Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-02-15 11:11:17


On Tuesday 15 February 2005 17:39, David Abrahams wrote:

> > What does not work in your case.
>
> compile c.cpp ;
> obj c : c.cpp ;
> time c-compilation : c.obj ;

Quite reasonable, there's no main target called "c.obj".

> >> I'm a little confused about what's going on here -- it seems as though
> >> we're being stopped by the built-in limitation that says two main
> >> targets can't have the same name. But surely it ought to be possible
> >> to write
> >>
> >> obj c : c.cpp ;
> >> exe c : c.obj ;
> >>
> >> or something very similar and simple. No?
> >
> > It's hard to guess if user meant two alternatives or two independent
> > targets. I though we need to allow some 'grist' in this cases, say:
> >
> > obj c.obj : c.cpp ; <- note 'obj' here.
> > exe c : c.obj ;
> >
> > When calling generator, we should strip the ".obj" from "c.obj" so that
> > suffix can actually vary between platforms. What do you think?
>
> That sounds reasonable. But then all of the following build requests
> should also be possible:
>
> bjam c.obj
> bjam c.exe

Hmm... there's no main target named "c.exe".

> bjam c # builds the exe
>
> and on unix,
>
> bjam c.o
>
> should probably work.

I think this is overly smart. The '.obj' in main target name is not necessary
related to file name. I should be able to write:

obj c.object : c.cpp ; <- note 'obj' here.
exe c : c.object ;

or use any other suffix of my liking. Or, to avoid confusion, we can use
'grist':

obj <object>c : c.cpp ; <- note 'obj' here.
exe c : <object>object ;

> So to translate that into what I'm doing, this should work:
>
> compile c.cpp ;
> obj c.obj : c.cpp ;
> time c-compilation : c.obj ;
>
> and only one copy of c.obj (or c.o if on Unix) should be built.

Understood. I'll see how hard will be to implement this part (without allowing
"c.o" in build request on Unix, I mean).

- 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