[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $cons{LIBS} and dependencies
From: |
Doug Alcorn |
Subject: |
Re: $cons{LIBS} and dependencies |
Date: |
27 Apr 2001 18:18:21 -0400 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Solid Vapor) |
Steven Knight <address@hidden> writes:
> On 27 Apr 2001, Doug Alcorn wrote:
> > However, I have to have a line like this:
> >
> > Depends $CONS "$TARGET", ( "$EXPORT/lib/libfoo.a",
> > "$EXPORT/lib/libbar.a","$EXPORT/lib/libbaz.a");
> >
> > In order to get the libraries built. Is this normal? Note that I do
> > have Library commands in my Conscripts to build libfoo.a libbar.a and
> > libbaz.a.
>
> Assuming you have the $EXPORT/lib directory somewhere in the
> environment's LIBPATH, you shouldn't have to specify the dependencies
> explicitly like this.
I have several "modules" within the same build environment. I create
the cons environment in the main Construct and export it. Then in the
main directory I modify that cons environment with a bunch of module
specific stuff (like LIBPATH, LIBS, CPPPATH, and CFLAGS). Here's what
I have in the main Conscript for one of the modules.
Import qw( CONS OS PLATFORM CHIP common SERVERDIR );
$EXPORT = "$SERVERDIR/export";
${$CONS}{LIBPATH} .= "$EXPORT/libs";
${$CONS}{LIBS} .= "-lfoo -lbar -lbaz";
@LIBS = ("$EXPORT/lib/libfoo.a","$EXPORT/lib/libbar.a","$EXPORT/lib/libbaz.a" );
push @{${$CONS}{CPPPATH}}, ("#foodir", "#bardir", "#bazdir");
@files = qw( file1.cpp file2.cpp file3.cpp );
Export qw( CONS OS PLATFORM CHIP common EXPORT);
Build ("#foodir");
Build ("#bardir");
Build ("#bazdir");
Depends $CONS "$EXPORT/$TARGET", @LIBS;
Program $CONS "$EXPORT/$TARGET", @files;
Without the Depends line, none of the libraries get built.
--
(__) Doug Alcorn (mailto:address@hidden http://www.lathi.net)
oo / PGP 02B3 1E26 BCF2 9AAF 93F1 61D7 450C B264 3E63 D543
|_/ If you're a capitalist and you have the best goods and they're
free, you don't have to proselytize, you just have to wait.