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: Kolarik, Tony
Subject: RE: building an obj file multiple places
Date: Thu, 5 Oct 2000 17:42:38 -0400

So from "thisdir/Conscript" I can call:
$cons->ObjectInDir( $cons, '../nextdoor/neighbor.cpp', DirPath('.') );

And in "../nextdoor/Conscript" I can call:
$cons->Program('neighbor.cpp');

(plus or minus some syntax errors) and in the linked directory tree I'll see
among other things:
        built/thisdir/neighbor.obj
        built/nextdoor/neighbor.obj

If so, that's exactly what I need... guess I'll go try it for myself!
Thanks a lot.
 -- Tony K.


> -----Original Message-----
> From: Johan Holmberg [mailto:address@hidden
> Sent: Thursday, October 05, 2000 12:11 PM
> To: address@hidden
> Subject: RE: building an obj file multiple places
> 
> 
> 
> 
> 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
> 
> 
> 
> _______________________________________________
> address@hidden
> http://mail.gnu.org/mailman/listinfo/cons-discuss
> Cons URL: http://www.dsmit.com/cons/
> 



reply via email to

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