cons-discuss
[Top][All Lists]
Advanced

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

Re: Using Default


From: Steven Knight
Subject: Re: Using Default
Date: Wed, 7 Feb 2001 19:55:03 -0600 (CST)

On Wed, 7 Feb 2001, Eric Brown wrote:
> Can anyone give me a better example of how the Default command works?  I'm
> trying to set up cons to install files as part of a post-processing pass.
        .
        .
        .
> Now, when I don't specify anything, everything builds great.  But when I run
> cons -- -install, all I get is
> 
> cons.bat: Nothing to build.
> cons.bat: "install" is up-to-date.
> 
> So what *exactly* does Default do?

"Default" just allows you to specify what targets will be built if there
are no targets at all specified on the command line.  The targets will
be built exactly as if the user *had* typed them on the command line.
As you found out, it does not create "special" targets that function
like pseudo-command targets in Make.

The canonical invocation is:

        Default('.');

which would build/install every file under the current directory
whenever anyone invokes "cons" with no arguments.  A common variant:

        Default('bld');

which would, by default, build/install all files in the subdirectory
'bld' AND all of those files' dependencies, regardless of where else
they might be in the tree.

If you really wanted to have Cons, by default, build everything
necessary to install everything in a particular destination bin
directory:

        Default('/usr/local/bin');

Then, if anyone invoked "cons" with no arguments, it would build/install
every file under /usr/local/bin, first making sure that any dependencies
files anywhere in its tree were updated--that is,, it would build the
command just like usual under the local tree, an then install it the
newly-build copy in /usr/local/bin.  (Note, of course, that that's not
usually what you want to have happen by default...)

        --SK




reply via email to

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