Create a wrapper function to more easily add swig stuff to the build
authorNathan Binkert <binkertn@umich.edu>
Thu, 21 Dec 2006 23:58:38 +0000 (15:58 -0800)
committerNathan Binkert <binkertn@umich.edu>
Thu, 21 Dec 2006 23:58:38 +0000 (15:58 -0800)
--HG--
extra : convert_revision : 3aaf540a9e314a88a8945579398f0d79aa85d5cf

src/python/SConscript

index be6248bab9e797d41f9af8e3d664401720b96ae1..1e49a18b2f9b0453110b4d0465f8c8db11497785 100644 (file)
@@ -98,18 +98,15 @@ pyzip_files.append('m5/defines.py')
 pyzip_files.append('m5/info.py')
 pyzip_files.append(join(env['ROOT'], 'util/pbs/jobfile.py'))
 
-env.Command(['swig/debug_wrap.cc', 'm5/internal/debug.py'],
-            'swig/debug.i',
-            '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
-            '-o ${TARGETS[0]} $SOURCES')
-
-env.Command(['swig/main_wrap.cc', 'm5/internal/main.py'],
-            'swig/main.i',
-            '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
-            '-o ${TARGETS[0]} $SOURCES')
-
-pyzip_dep_files.append('m5/internal/debug.py')
-pyzip_dep_files.append('m5/internal/main.py')
+def swig_it(basename):
+    env.Command(['swig/%s_wrap.cc' % basename, 'm5/internal/%s.py' % basename],
+                'swig/%s.i' % basename,
+                '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
+                '-o ${TARGETS[0]} $SOURCES')
+    pyzip_dep_files.append('m5/internal/%s.py' % basename)
+
+swig_it('main')
+swig_it('debug')
 
 # Action function to build the zip archive.  Uses the PyZipFile module
 # included in the standard Python library.