cons-discuss
[Top][All Lists]
Advanced

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

Re: Command, Depends, NT questions


From: Steven Knight
Subject: Re: Command, Depends, NT questions
Date: Fri, 27 Oct 2000 17:24:09 -0500 (CDT)

On Fri, 27 Oct 2000, Zachary Deretsky wrote:
> 1. Do I understand it correctly that cons looks at targets of the Command
> calls and
> then processes Depens calls for these targets?

It depends on what you mean by "processes Depends calls."  The real model
is simply that both Command and Depends calls establish dependencies for
a target or targets.  If any dependency is out-of-date, the target(s)
is/are built as specified by the Command method.

>                                                According to my experiments
> if
> target is a list then only the first element is processed. In the above
> "Depends $CONS 'ringspyapi.py', qw(rings.i rings.ii FISH);" is never
> processed.
> Is this a bug or a feature?

This is a slight misunderstanding of how Perl handles lists.  The way
you're using qw() shows that you're intending all of the listed element
to be targets, but Perl actually expands the list returned by qw()
and makes it part of the entire argument list for the method call.
In other words, the following two lines are equivalent:

        Command $CONS qw(rings.cpy ringspyapi.py), qw(rings.i), ...

        Command $CONS 'rings.cpy', 'ringspyapi.py', 'rings.i', ...

Consequently, the way Perl processes lists means that Cons is
only seeing the first file as the target.

To get the Command method to use multiple targets, you must supply an
array reference.  The easiest way to do this is to enclose the qw()
list in brackets to make an anonymous array ref:

        Command $CONS [qw(rings.cpy ringspyapi.py)], qw(rings.i), ...

> 2. Apparently dependencies are not recursive: although rings.cpy depends on
> rings.i,
> dependencies of rings.i (with FISH) are never processed.

You've specified dependencies of rings.i, but you've never specified any
place where it's actually built (i.e., no Command for it).  That probably
explains why it isn't processed...

> 3. What causes a file from the source directory to be copied (on NT which
> does not
> have links) to the build directory? In my case I need rings.iim included
> into rings.i
> to be present in the build directory.

I'm not clear what you're asking.  Is this when using the Link method?

> 4. Which directories are searched for the files in Depends method?

None.  The path names are relative to the directory in which the Conscript
file lives, relative to the Construct file if '#' is appended to the
beginning, or absolute.

        --SK




reply via email to

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