summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Environment.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Environment.py')
-rw-r--r--src/engine/SCons/Environment.py27
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