cons-discuss
[Top][All Lists]
Advanced

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

RE: building an obj file multiple places


From: Johan Holmberg
Subject: RE: building an obj file multiple places
Date: Thu, 5 Oct 2000 18:11:14 +0200 (MET DST)

On Thu, 5 Oct 2000, Kolarik, Tony wrote:
> 
> Based on the lack of response I assume there's no easy way to do this.  (or
> its a secret :-)
> 

I didn't answer, because I wasn't sure I understood
the question :-)

In your earlier mail you asked about Link-ing files rather than
directories. That doesn't work. From the cons source:

  # Link a directory to another. This simply means set up the *source*
  # for the directory to be the other directory.
  sub Link {
     ...
  }

> But, could someone explain why its undesirable to build the same source file
> two ways as long as it builds separate objs?  Thanks,
>  -- Tony K.
> 

I don't see any problems with this.
As long as you tell cons how to build the different object files,
there should be no problem that the same source is used several
times.

I assume that  you build the object files in different way,
otherwise you could have one just be "Intall"-ed from the other.

To make it easy to direct the object file into another direectory I
have create a method:

#------------------------------------------------------------
sub cons::ObjectInDir {
    my($env, $src, $objdir) = @_;

    my $suffix = $env->{SUFOBJ};
    my $srcref = $dir::cwd->lookup($src);
    my $objref = $dir::cwd->lookupdir($objdir)->lookup($srcref->base.$suffix);
    my $r =_Object $env $srcref,$objref;
    return $r->path;
}
#------------------------------------------------------------

/Johan Holmberg





reply via email to

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