build: Add missing dependencies when building param SWIG interfaces
authorAndreas Sandberg <Andreas.Sandberg@arm.com>
Tue, 25 Sep 2012 16:49:40 +0000 (11:49 -0500)
committerAndreas Sandberg <Andreas.Sandberg@arm.com>
Tue, 25 Sep 2012 16:49:40 +0000 (11:49 -0500)
This patch adds an explicit dependency between param_%s.i and the
Python source file defining the object. Previously, the build system
didn't rebuild SWIG interfaces correctly when an object's Python
sources were updated.

src/SConscript

index 8c407f4c72ce956a7dc1a1b38a6d3e08efbd233d..69a452ac6ffe7e585a7dbaa462104fbbd0e6a58b 100755 (executable)
@@ -634,11 +634,14 @@ for name,enum in sorted(all_enums.iteritems()):
     SwigSource('m5.internal', i_file)
 
 # Generate SimObject SWIG wrapper files
-for name in sim_objects.iterkeys():
+for name,simobj in sim_objects.iteritems():
+    py_source = PySource.modules[simobj.__module__]
+    extra_deps = [ py_source.tnode ]
+
     i_file = File('python/m5/internal/param_%s.i' % name)
     env.Command(i_file, Value(name),
                 MakeAction(createSimObjectSwigWrapper, Transform("SO SWIG")))
-    env.Depends(i_file, depends)
+    env.Depends(i_file, depends + extra_deps)
     SwigSource('m5.internal', i_file)
 
 # Generate the main swig init file