From d4767f440a7a8bfefa0851726b729b8d30a654a5 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Mon, 15 Nov 2010 14:04:04 -0600 Subject: SCons: Cleanup SCons output during compile --- src/SConscript | 48 +++++++++++++++++++++++++++++++----------------- src/arch/SConscript | 3 ++- src/arch/isa_parser.py | 2 +- src/cpu/SConscript | 2 +- 4 files changed, 35 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/SConscript b/src/SConscript index c0718c66b..524841d75 100644 --- a/src/SConscript +++ b/src/SConscript @@ -289,7 +289,8 @@ def makeTheISA(source, target, env): code.write(str(target[0])) -env.Command('config/the_isa.hh', map(Value, all_isa_list), makeTheISA) +env.Command('config/the_isa.hh', map(Value, all_isa_list), + MakeAction(makeTheISA, " [ CFG ISA] $STRIP_TARGET")) ######################################################################## # @@ -431,7 +432,8 @@ del _globals defines_info = [ Value(build_env), Value(env['HG_INFO']) ] # Generate a file with all of the compile options in it -env.Command('python/m5/defines.py', defines_info, makeDefinesPyFile) +env.Command('python/m5/defines.py', defines_info, + MakeAction(makeDefinesPyFile, " [ DEFINES] $STRIP_TARGET")) PySource('m5', 'python/m5/defines.py') # Generate python file containing info about the M5 source code @@ -445,7 +447,7 @@ def makeInfoPyFile(target, source, env): # Generate a file that wraps the basic top level files env.Command('python/m5/info.py', [ '#/AUTHORS', '#/LICENSE', '#/README', '#/RELEASE_NOTES' ], - makeInfoPyFile) + MakeAction(makeInfoPyFile, " [ INFO] $STRIP_TARGET")) PySource('m5', 'python/m5/info.py') ######################################################################## @@ -520,7 +522,8 @@ for name,simobj in sorted(sim_objects.iteritems()): hh_file = File('params/%s.hh' % name) params_hh_files.append(hh_file) - env.Command(hh_file, Value(name), createSimObjectParam) + env.Command(hh_file, Value(name), + MakeAction(createSimObjectParam, " [SO PARAM] $STRIP_TARGET")) env.Depends(hh_file, depends + extra_deps) # Generate any parameter header files needed @@ -528,7 +531,8 @@ params_i_files = [] for name,param in all_params.iteritems(): i_file = File('python/m5/internal/%s_%s.i' % (param.file_ext, name)) params_i_files.append(i_file) - env.Command(i_file, Value(name), createSwigParam) + env.Command(i_file, Value(name), + MakeAction(createSwigParam, " [SW PARAM] $STRIP_TARGET")) env.Depends(i_file, depends) SwigSource('m5.internal', i_file) @@ -538,16 +542,19 @@ for name,enum in sorted(all_enums.iteritems()): extra_deps = [ py_source.tnode ] cc_file = File('enums/%s.cc' % name) - env.Command(cc_file, Value(name), createEnumStrings) + env.Command(cc_file, Value(name), + MakeAction(createEnumStrings, " [ENUM STR] $STRIP_TARGET")) env.Depends(cc_file, depends + extra_deps) Source(cc_file) hh_file = File('enums/%s.hh' % name) - env.Command(hh_file, Value(name), createEnumParam) + env.Command(hh_file, Value(name), + MakeAction(createEnumParam, " [EN PARAM] $STRIP_TARGET")) env.Depends(hh_file, depends + extra_deps) i_file = File('python/m5/internal/enum_%s.i' % name) - env.Command(i_file, Value(name), createEnumSwig) + env.Command(i_file, Value(name), + MakeAction(createEnumSwig, " [ENUMSWIG] $STRIP_TARGET")) env.Depends(i_file, depends + extra_deps) SwigSource('m5.internal', i_file) @@ -586,7 +593,8 @@ def buildParam(target, source, env): for name in sim_objects.iterkeys(): params_file = File('python/m5/internal/param_%s.i' % name) - env.Command(params_file, Value(name), buildParam) + env.Command(params_file, Value(name), + MakeAction(buildParam, " [BLDPARAM] $STRIP_TARGET")) env.Depends(params_file, depends) SwigSource('m5.internal', params_file) @@ -608,10 +616,11 @@ EmbeddedSwig embed_swig_${module}(init_${module}); # Build all swig modules for swig in SwigSource.all: env.Command([swig.cc_source.tnode, swig.py_source.tnode], swig.tnode, - '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} ' - '-o ${TARGETS[0]} $SOURCES') + MakeAction('$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} ' + '-o ${TARGETS[0]} $SOURCES', " [ SWIG] $STRIP_TARGET")) init_file = 'python/swig/init_%s.cc' % swig.module - env.Command(init_file, Value(swig.module), makeEmbeddedSwigInit) + env.Command(init_file, Value(swig.module), + MakeAction(makeEmbeddedSwigInit, " [EMBED SW] $STRIP_TARGET")) Source(init_file) env.Depends(swig.py_source.tnode, swig.tnode) env.Depends(swig.cc_source.tnode, swig.tnode) @@ -836,11 +845,14 @@ extern const Flags *compoundFlags[]; code.write(str(target[0])) flags = map(Value, trace_flags.values()) -env.Command('base/traceflags.py', flags, traceFlagsPy) +env.Command('base/traceflags.py', flags, + MakeAction(traceFlagsPy, " [ TRACING] $STRIP_TARGET")) PySource('m5', 'base/traceflags.py') -env.Command('base/traceflags.hh', flags, traceFlagsHH) -env.Command('base/traceflags.cc', flags, traceFlagsCC) +env.Command('base/traceflags.hh', flags, + MakeAction(traceFlagsHH, " [ TRACING] $STRIP_TARGET")) +env.Command('base/traceflags.cc', flags, + MakeAction(traceFlagsCC, " [ TRACING] $STRIP_TARGET")) Source('base/traceflags.cc') # Embed python files. All .py files that have been indicated by a @@ -897,7 +909,8 @@ EmbeddedPython embedded_${sym}( code.write(str(target[0])) for source in PySource.all: - env.Command(source.cpp, source.tnode, embedPyFile) + env.Command(source.cpp, source.tnode, + MakeAction(embedPyFile, " [EMBED PY] $STRIP_TARGET")) Source(source.cpp) ######################################################################## @@ -988,7 +1001,8 @@ def makeEnv(label, objsfx, strip = False, **kwargs): cmd = 'cp $SOURCE $TARGET; strip $TARGET' else: cmd = 'strip $SOURCE -o $TARGET' - targets = new_env.Command(exename, progname, cmd) + targets = new_env.Command(exename, progname, + MakeAction(cmd, " [ STRIP] $STRIP_TARGET")) new_env.M5Binary = targets[0] envList.append(new_env) diff --git a/src/arch/SConscript b/src/arch/SConscript index 9ebc6986b..dd337b1b7 100644 --- a/src/arch/SConscript +++ b/src/arch/SConscript @@ -109,7 +109,7 @@ ARCH_DIR = Dir('.') # import ply here because SCons screws with sys.path when performing actions. import ply -def isa_desc_action(target, source, env): +def isa_desc_action_func(target, source, env): # Add the current directory to the system path so we can import files sys.path[0:0] = [ ARCH_DIR.srcnode().abspath ] import isa_parser @@ -118,6 +118,7 @@ def isa_desc_action(target, source, env): cpu_models = [CpuModel.dict[cpu] for cpu in models] parser = isa_parser.ISAParser(target[0].dir.abspath, cpu_models) parser.parse_isa_desc(source[0].abspath) +isa_desc_action = MakeAction(isa_desc_action_func, " [ISA DESC] $STRIP_SOURCE") # Also include the CheckerCPU as one of the models if it is being # enabled via command line. diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py index 8e13b6a6a..4c23529f0 100755 --- a/src/arch/isa_parser.py +++ b/src/arch/isa_parser.py @@ -1945,7 +1945,7 @@ StaticInstPtr else: print 'File', file, 'is unchanged' else: - print 'Generating', file + print ' [GENERATE]', file update = True if update: f = open(file, 'w') diff --git a/src/cpu/SConscript b/src/cpu/SConscript index 6b4c43dc0..35e92a1b6 100644 --- a/src/cpu/SConscript +++ b/src/cpu/SConscript @@ -87,7 +87,7 @@ def gen_cpu_exec_signatures(target, source, env): # Generate string that gets printed when header is rebuilt def gen_sigs_string(target, source, env): - return "Generating static_inst_exec_sigs.hh: " \ + return " [GENERATE] static_inst_exec_sigs.hh: " \ + ', '.join(temp_cpu_list) # Add command to generate header to environment. -- cgit v1.2.3