diff -r f4362ffd810f SConstruct --- a/SConstruct Mon Nov 08 12:43:38 2010 -0800 +++ b/SConstruct Tue Nov 09 21:00:58 2010 -0600 @@ -313,6 +313,7 @@ ('BATCH', 'Use batch pool for build and tests', False), ('BATCH_CMD', 'Batch pool submission command name', 'qdo'), ('M5_BUILD_CACHE', 'Cache built objects in this directory', False), + ('VERBOSE', 'Print full tool command lines', False), ('EXTRAS', 'Add Extra directories to the compilation', '', PathListAllExist, PathListMakeAbsolute), ) @@ -346,6 +347,16 @@ # the ext directory should be on the #includes path main.Append(CPPPATH=[Dir('ext')]) +if not main['VERBOSE']: + main['CCCOMSTR'] = ' [ C] $SOURCE' + main['CXXCOMSTR'] = ' [CC] $SOURCE' + main['ASCOMSTR'] = ' [AS] $SOURCE' + main['SWIGCOMSTR'] = ' [SW] $SOURCE' + main['ARCOMSTR'] = ' [AR] $TARGET' + main['LINKCOMSTR'] = ' [LN] $TARGET' + main['RANLIBCOMSTR'] = ' [RN] $TARGET' + main['M4COMSTR'] = ' [M4] $TARGET' + CXX_version = readCommand([main['CXX'],'--version'], exception=False) CXX_V = readCommand([main['CXX'],'-V'], exception=False) @@ -789,7 +800,7 @@ # String to print when generating header def gen_switch_hdr_string(target, source, env): - return "Generating switch header " + str(target[0]) + return " [GN] " + str(target[0]) # Build SCons Action object. 'varlist' specifies env vars that this # action depends on; when env['ALL_ISA_LIST'] changes these actions diff -r f4362ffd810f src/SConscript --- a/src/SConscript Mon Nov 08 12:43:38 2010 -0800 +++ b/src/SConscript Tue Nov 09 21:00:58 2010 -0600 @@ -54,6 +54,17 @@ from m5.util import code_formatter ######################################################################## +# Code for tricking the Action() call into either printing a shorthand +# output or the full Command() string depending on verbosity +# +def getOutput(shorthand): + if not env['VERBOSE']: + return (shorthand,) + else: + return tuple() + + +######################################################################## # Code for adding source files of various types # class SourceMeta(type): @@ -289,7 +300,8 @@ 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), + Action(makeTheISA, *getOutput(" [IA] $TARGET"))) ######################################################################## # @@ -431,7 +443,8 @@ 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, + Action(makeDefinesPyFile, *getOutput(" [DF] $TARGET"))) PySource('m5', 'python/m5/defines.py') # Generate python file containing info about the M5 source code @@ -445,7 +458,7 @@ # Generate a file that wraps the basic top level files env.Command('python/m5/info.py', [ '#/AUTHORS', '#/LICENSE', '#/README', '#/RELEASE_NOTES' ], - makeInfoPyFile) + Action(makeInfoPyFile, *getOutput(" [IF] $TARGET"))) PySource('m5', 'python/m5/info.py') ######################################################################## @@ -520,7 +533,8 @@ 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), + Action(createSimObjectParam, *getOutput(" [SM] $TARGET"))) env.Depends(hh_file, depends + extra_deps) # Generate any parameter header files needed @@ -528,7 +542,8 @@ 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), + Action(createSwigParam, *getOutput(" [SG] $SOURCE"))) env.Depends(i_file, depends) SwigSource('m5.internal', i_file) @@ -538,16 +553,19 @@ 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), + Action(createEnumStrings, *getOutput(" [ES] $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), + Action(createEnumParam, *getOutput(" [EN] $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), + Action(createEnumSwig, *getOutput(" [EW] $SOURCE"))) env.Depends(i_file, depends + extra_deps) SwigSource('m5.internal', i_file) @@ -586,7 +604,8 @@ 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), + Action(buildParam, *getOutput(" [PM] $TARGET"))) env.Depends(params_file, depends) SwigSource('m5.internal', params_file) @@ -608,10 +627,11 @@ # 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') + Action('$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} ' + '-o ${TARGETS[0]} $SOURCES', *getOutput(" [SW] $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), + Action(makeEmbeddedSwigInit, *getOutput(" [SW] $TARGET"))) Source(init_file) env.Depends(swig.py_source.tnode, swig.tnode) env.Depends(swig.cc_source.tnode, swig.tnode) @@ -836,11 +856,14 @@ code.write(str(target[0])) flags = map(Value, trace_flags.values()) -env.Command('base/traceflags.py', flags, traceFlagsPy) +env.Command('base/traceflags.py', flags, + Action(traceFlagsPy, *getOutput(" [TF] $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, + Action(traceFlagsHH, *getOutput(" [TF] $TARGET"))) +env.Command('base/traceflags.cc', flags, + Action(traceFlagsCC, *getOutput(" [TF] $TARGET"))) Source('base/traceflags.cc') # Embed python files. All .py files that have been indicated by a @@ -897,7 +920,8 @@ code.write(str(target[0])) for source in PySource.all: - env.Command(source.cpp, source.tnode, embedPyFile) + env.Command(source.cpp, source.tnode, + Action(embedPyFile, *getOutput(" [EP] $TARGET"))) Source(source.cpp) ######################################################################## diff -r f4362ffd810f src/arch/isa_parser.py --- a/src/arch/isa_parser.py Mon Nov 08 12:43:38 2010 -0800 +++ b/src/arch/isa_parser.py Tue Nov 09 21:00:58 2010 -0600 @@ -1945,7 +1945,7 @@ else: print 'File', file, 'is unchanged' else: - print 'Generating', file + print ' [GN]', file update = True if update: f = open(file, 'w') diff -r f4362ffd810f src/cpu/SConscript --- a/src/cpu/SConscript Mon Nov 08 12:43:38 2010 -0800 +++ b/src/cpu/SConscript Tue Nov 09 21:00:58 2010 -0600 @@ -87,7 +87,7 @@ # Generate string that gets printed when header is rebuilt def gen_sigs_string(target, source, env): - return "Generating static_inst_exec_sigs.hh: " \ + return " [GN] static_inst_exec_sigs.hh: " \ + ', '.join(temp_cpu_list) # Add command to generate header to environment.