remove(release_dir, 'util/chgcopyright')
remove(release_dir, 'util/make_release.py')
-# fix up the SConscript to deal with files we've removed
-mem_expr = re.compile('.*mem/cache/(tags/split|prefetch/(ghb|stride)).*')
-inscript = file(joinpath(release_dir, 'src', 'SConscript'), 'r').readlines()
-outscript = file(joinpath(release_dir, 'src', 'SConscript'), 'w')
-for line in inscript:
- if mem_expr.match(line):
- continue
-
- outscript.write(line)
-outscript.close()
+def remove_sources(regex, subdir):
+ script = joinpath(release_dir, subdir, 'SConscript')
+ if isinstance(regex, str):
+ regex = re.compile(regex)
+ inscript = file(script, 'r').readlines()
+ outscript = file(script, 'w')
+ for line in inscript:
+ if regex.match(line):
+ continue
+
+ outscript.write(line)
+ outscript.close()
# fix up the SConscript to deal with files we've removed
-mem_expr = re.compile('.*i8254xGBe.*')
-inscript = file(joinpath(release_dir, 'src', 'dev', 'SConscript'), 'r').readlines()
-outscript = file(joinpath(release_dir, 'src', 'dev', 'SConscript'), 'w')
-for line in inscript:
- if mem_expr.match(line):
- continue
-
- outscript.write(line)
-outscript.close()
-
-
-
+remove_sources(r'.*split.*\.cc', 'src/mem/cache/tags')
+remove_sources(r'.*(ghb|stride)_prefetcher\.cc', 'src/mem/cache/prefetch')
+remove_sources(r'.*i8254xGBe.*', 'src/dev')
benches = [ 'bzip2', 'eon', 'gzip', 'mcf', 'parser', 'perlbmk',
'twolf', 'vortex' ]