diff options
author | Steven Knight <knight@baldmt.com> | 2003-02-05 22:06:52 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-02-05 22:06:52 (GMT) |
commit | 1321ef0af677827deb274d698d06ffa8b73010b0 (patch) | |
tree | 12db09379f94382c56b55b9050e5e59950344867 /src | |
parent | 15e31b8bda9f093971af3c3b0136b043ebb02746 (diff) | |
download | SCons-1321ef0af677827deb274d698d06ffa8b73010b0.zip SCons-1321ef0af677827deb274d698d06ffa8b73010b0.tar.gz SCons-1321ef0af677827deb274d698d06ffa8b73010b0.tar.bz2 |
Change the default behavior when no arguments are specified to building everything in (or below) the current directory.
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 4 | ||||
-rw-r--r-- | src/RELEASE.txt | 6 | ||||
-rw-r--r-- | src/engine/SCons/Script/SConscript.py | 9 | ||||
-rw-r--r-- | src/engine/SCons/Script/__init__.py | 2 |
4 files changed, 19 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 0dea107..237aa60 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -60,6 +60,10 @@ RELEASE 0.11 - XXX between builds, with related options --cache-disable, --cache-force, and --cache-show. + - Change the default behavior when no targets are specified to build + everything in the current directory and below (like Make). This + can be disabled by specifying Default(None) in an SConscript. + From Steve Leblanc: - Fix the output of -c -n when directories are involved, so it diff --git a/src/RELEASE.txt b/src/RELEASE.txt index ccb301c..f6fef16 100644 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -72,6 +72,12 @@ RELEASE 0.10 - Thu, 16 Jan 2003 04:11:46 -0600 If you have defined a strfunction() for a Python function Action, you will need to add a third "env" argument to your function call. + - The default behavior when no targets are specified has been changed + to be like Make: everything in the current directory and below will + be built. This can be disabled by specifying "Default(None)" in an + SConscript, in which case there will be no default targets and + SCons will print an appropriate error message. + Please note the following important changes since release 0.09: - The Scanner interface has been changed to make it easier to diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 7cfb312..5c4a2b3 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -51,7 +51,7 @@ import sys def do_nothing(text): pass HelpFunction = do_nothing -default_targets = [] +default_targets = None clean_targets = {} arguments = {} launch_dir = os.path.abspath(os.curdir) @@ -204,8 +204,13 @@ def SConscript(*ls, **kw): return tuple(results) def Default(*targets): + global default_targets + if default_targets is None: + default_targets = [] for t in targets: - if isinstance(t, SCons.Node.Node): + if t is None: + default_targets = [] + elif isinstance(t, SCons.Node.Node): default_targets.append(t) else: default_targets.extend(SCons.Node.arg2nodes(t, diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 8bc3da4..eed045d 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -811,6 +811,8 @@ def _main(): if not targets: targets = SCons.Script.SConscript.default_targets + if targets is None: + targets = [SCons.Node.FS.default_fs.Dir('.')] if not targets: sys.stderr.write("scons: *** No targets specified and no Default() targets found. Stop.\n") |