cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Separate obj tree


From: Johan Holmberg
Subject: Re: Separate obj tree
Date: Mon, 2 Oct 2000 10:45:14 +0200 (MET DST)

On Fri, 29 Sep 2000, Kolarik, Tony wrote:
> 
> Has anyone created a build with a Link() like capability that creates a
> duplicate "source" tree without the sources, just the objects?  
> 
> On NT all the files get physically copied to the Linked tree.  I know disk
> space is cheap, but I'm curious how feasible a separate object tree would
> be.  Off the top of my head I can't think of a compelling reason why the
> sources need to be Linked, even on a system with real file links.
>  -- Tony K.
> 

I have avoided Link() for the same reasons that others have
mentioned: the physical copying of files in NT, and the problem of
finding (and editing) the right source when fixing compiler errors
(eg. in Emacs).

But I also want to build my software in several variants
(Debug/Release/...) and on several platforms (NT, Solaris, HPUX, Linux, ...)

My "solution" to this has been to make a new method ("ObjectsInDir")
in the cons class, to use instead of "Objects". My method takes one
(or several) source files and an object directory as arguments. By
systematically varying the object directory I get the following
directory layout:


    src/appl1/*.cpp
    src/appl2/*.cpp

    build/solaris/Release/appl1-obj/
    build/solaris/Release/appl2-obj/
    build/solaris/Release/bin/
    build/solaris/Debug/appl1-obj/
    build/solaris/Debug/appl2-obj/
    build/solaris/Debug/bin/

    build/MSWin32/Release/appl1-obj/
    build/MSWin32/Release/appl2-obj/
    build/MSWin32/Release/bin/
    build/MSWin32/Debug/appl1-obj/
    build/MSWin32/Debug/appl2-obj/
    build/MSWin32/Debug/bin/

    [... same for linux, hpux, ....]


Generated "sources" (from YACC-like tools) I place among the real
sources (we have just a couple of generated sources). I have been
thinking about placing them under something like:

    build/generated-source/appl1
    build/generated-source/appl2

to avoid having any derived objects at all in the source tree.

My usage of "ObjectsInDir" is maybe not as "simple" as using "Link"
would have been. But I don't feel that is a problem. I generally avoid
using *any* of the built-in methods in cons directly in the Construct
file. Instead I have some application-oriented methods that I invoke in
this way (in the Construct file):

    use MyConsStuff;

    MyConsMethod( ... "foo.c", "bar.c", ....,
                  variants => "Debug,Release",
                  ....);


/Johan Holmberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]