Add SENF_TIMING_CRITICAL_TESTS environment flag
[senf.git] / SConstruct
index dd029f1..60683ef 100644 (file)
@@ -190,14 +190,14 @@ if env.GetOption('clean'):
 env.Clean('all', ('.prepare-stamp', env.Dir('dist')))
 if env.GetOption('clean') : env.Depends('all', ('lcov', 'all_valgrinds'))
 
-if env.GetOption('clean'):
+if env.GetOption('clean') and     'all' in BUILD_TARGETS:
     env.Clean('all', [ os.path.join(path,f)
                        for path, subdirs, files in os.walk('.')
                        for pattern in env['CLEAN_PATTERNS']
                        for f in fnmatch.filter(files,pattern) ])
-    if 'all' in BUILD_TARGETS:
-        import SCons.SConsign
-        SCons.SConsign.write = lambda : None
+    # Disable writing to the deleted .sconsign file
+    import SCons.SConsign
+    SCons.SConsign.write = lambda : None
 
 if not env.GetOption('clean') and not os.path.exists(".prepare-stamp"):
     Execute(Touch(".prepare-stamp"))