diff options
| author | Steven Knight <knight@baldmt.com> | 2003-09-10 13:19:03 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2003-09-10 13:19:03 (GMT) |
| commit | e181e48bb62502b88107536c2e8dbd5886bf17fd (patch) | |
| tree | e835fcf4a2cf7f45f7af2386a58e1104c6ecc710 /src/engine/SCons/Environment.py | |
| parent | e10b74a59f1830769ba4c7e65a846228812ae2fa (diff) | |
| download | SCons-e181e48bb62502b88107536c2e8dbd5886bf17fd.zip SCons-e181e48bb62502b88107536c2e8dbd5886bf17fd.tar.gz SCons-e181e48bb62502b88107536c2e8dbd5886bf17fd.tar.bz2 | |
Make a Clean() environment method. Add global functions for AlwaysBuild(), Command(), Depends(), Ignore(), Install(), InstallAs(), Precious(), SideEffect() and SourceCode().
Diffstat (limited to 'src/engine/SCons/Environment.py')
| -rw-r--r-- | src/engine/SCons/Environment.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 074fd3c..f2cc03f 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -50,6 +50,9 @@ import SCons.Errors import SCons.Node import SCons.Node.FS import SCons.Platform +import SCons.Sig +import SCons.Sig.MD5 +import SCons.Sig.TimeStamp import SCons.Tool import SCons.Util import SCons.Warnings @@ -60,6 +63,8 @@ class _Null: _null = _Null DefaultTargets = None +CleanTargets = {} +SigModule = None def installFunc(target, source, env): """Install a source file into a target using the function specified @@ -603,6 +608,28 @@ class Environment: tlist = tlist[0] return tlist + def Clean(self, target, files): + global CleanTargets + + if not isinstance(target, SCons.Node.Node): + target = self.subst(target) + target = SCons.Node.FS.default_fs.Entry(target, create=1) + + if not SCons.Util.is_List(files): + files = [files] + + nodes = [] + for f in files: + if isinstance(f, SCons.Node.Node): + nodes.append(f) + else: + nodes.extend(self.arg2nodes(f, self.fs.Entry)) + + try: + CleanTargets[target].extend(nodes) + except KeyError: + CleanTargets[target] = nodes + def Command(self, target, source, action): """Builds the supplied target files from the supplied source files using the supplied action. Action may |
