diff -r 79fdc781826a -r 64e44ccdbf4a src/SConscript --- a/src/SConscript Mon Sep 29 11:34:44 2014 +0100 +++ b/src/SConscript Mon Sep 29 11:35:05 2014 +0100 @@ -629,6 +629,10 @@ obj.swig_decl(code) code.write(target[0].abspath) +# dummy target for generated code +# we start out with all the Source files so they get copied to build/*/ also. +SWIG = env.Dummy('swig', [s.tnode for s in Source.get()]) + # Generate all of the SimObject param C++ struct header files params_hh_files = [] for name,simobj in sorted(sim_objects.iteritems()): @@ -640,6 +644,7 @@ env.Command(hh_file, Value(name), MakeAction(createSimObjectParamStruct, Transform("SO PARAM"))) env.Depends(hh_file, depends + extra_deps) + env.Depends(SWIG, hh_file) # Generate any needed param SWIG wrapper files params_i_files = [] @@ -649,6 +654,7 @@ env.Command(i_file, Value(name), MakeAction(createParamSwigWrapper, Transform("SW PARAM"))) env.Depends(i_file, depends) + env.Depends(SWIG, i_file) SwigSource('m5.internal', i_file, skip_no_swig=True) # Generate all enum header files @@ -660,17 +666,20 @@ env.Command(cc_file, Value(name), MakeAction(createEnumStrings, Transform("ENUM STR"))) env.Depends(cc_file, depends + extra_deps) + env.Depends(SWIG, cc_file) Source(cc_file) hh_file = File('enums/%s.hh' % name) env.Command(hh_file, Value(name), MakeAction(createEnumDecls, Transform("ENUMDECL"))) env.Depends(hh_file, depends + extra_deps) + env.Depends(SWIG, hh_file) i_file = File('python/m5/internal/enum_%s.i' % name) env.Command(i_file, Value(name), MakeAction(createEnumSwigWrapper, Transform("ENUMSWIG"))) env.Depends(i_file, depends + extra_deps) + env.Depends(SWIG, i_file) SwigSource('m5.internal', i_file, skip_no_swig=True) # Generate SimObject SWIG wrapper files @@ -682,6 +691,7 @@ env.Command(i_file, Value(name), MakeAction(createSimObjectSwigWrapper, Transform("SO SWIG"))) env.Depends(i_file, depends + extra_deps) + env.Depends(SWIG, i_file) SwigSource('m5.internal', i_file, skip_no_swig=True) # Generate the main swig init file @@ -708,6 +718,7 @@ init_file = '%s/%s_init.cc' % (dirname(cc_file), basename(cc_file)) env.Command(init_file, Value(swig.module), MakeAction(makeEmbeddedSwigInit, Transform("EMBED SW"))) + env.Depends(SWIG, init_file) Source(init_file, **swig.guards) # Build all protocol buffers if we have got protoc and protobuf available @@ -722,6 +733,7 @@ '--proto_path ${SOURCE.dir} $SOURCE', Transform("PROTOC"))) + env.Depends(SWIG, [proto.cc_file, proto.hh_file]) # Add the C++ source file Source(proto.cc_file, **proto.guards) elif ProtoBuf.all: @@ -818,10 +830,13 @@ n, compound, desc = flag assert n == name - env.Command('debug/%s.hh' % name, Value(flag), + hh_file = 'debug/%s.hh' % name + cc_file = 'debug/%s.cc' % name + env.Command(hh_file, Value(flag), MakeAction(makeDebugFlagHH, Transform("TRACING", 0))) - env.Command('debug/%s.cc' % name, Value(flag), + env.Command(cc_file, Value(flag), MakeAction(makeDebugFlagCC, Transform("TRACING", 0))) + env.Depends(SWIG, [hh_file, cc_file]) Source('debug/%s.cc' % name) # Embed python files. All .py files that have been indicated by a @@ -880,6 +895,7 @@ for source in PySource.all: env.Command(source.cpp, source.tnode, MakeAction(embedPyFile, Transform("EMBED PY"))) + env.Depends(SWIG, source.cpp) Source(source.cpp, skip_no_embed_python=True) ########################################################################