summaryrefslogtreecommitdiff
path: root/sim/pyconfig/SConscript
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2005-03-09 13:44:19 -0500
committerRon Dreslinski <rdreslin@umich.edu>2005-03-09 13:44:19 -0500
commitffaba200d1078f19a1d56af803420a79a96f7fe2 (patch)
treea24789bceac0ce3718baee689068a68cc533b1d4 /sim/pyconfig/SConscript
parenta99607863fd80a1a81c29aa3d24553ece2ab8d47 (diff)
parent21946f071026d3b3c4122ef41d755f883e22e668 (diff)
downloadgem5-ffaba200d1078f19a1d56af803420a79a96f7fe2.tar.xz
Merge zizzer:/z/m5/Bitkeeper/m5
into zizzer.eecs.umich.edu:/.automount/zazzer/z/rdreslin/m5bk/timing_L1 --HG-- extra : convert_revision : 0121d59e46f0961f753c2e1bd0fa1c63642d859e
Diffstat (limited to 'sim/pyconfig/SConscript')
-rw-r--r--sim/pyconfig/SConscript30
1 files changed, 27 insertions, 3 deletions
diff --git a/sim/pyconfig/SConscript b/sim/pyconfig/SConscript
index 9154d3b99..95785d372 100644
--- a/sim/pyconfig/SConscript
+++ b/sim/pyconfig/SConscript
@@ -144,6 +144,28 @@ def MakeEmbeddedPyFile(target, source, env):
for pyfile, path, name, ext, filename in files:
WriteEmbeddedPyFile(target, pyfile, path, name, ext, filename)
+def MakeDefinesPyFile(target, source, env):
+ target = file(str(target[0]), 'w')
+
+ defines = env['CPPDEFINES']
+ if isinstance(defines, list):
+ for var in defines:
+ if isinstance(var, tuple):
+ key,val = var
+ else:
+ key,val = var,'True'
+
+ if not isinstance(key, basestring):
+ panic("invalid type for define: %s" % type(key))
+
+ print >>target, "env['%s'] = '%s'" % (key, val)
+
+ elif isinstance(defines, dict):
+ for key,val in defines.iteritems():
+ print >>target, "env['%s'] = '%s'" % (key, val)
+ else:
+ panic("invalid type for defines: %s" % type(defines))
+
CFileCounter = 0
def MakePythonCFile(target, source, env):
global CFileCounter
@@ -170,7 +192,7 @@ EmbedMap %(name)s("%(fname)s",
/* namespace */ }
'''
-embedded_py_files = ['m5config.py', '../../util/pbs/jobfile.py']
+embedded_py_files = ['m5config.py', 'importer.py', '../../util/pbs/jobfile.py']
objpath = os.path.join(env['SRCDIR'], 'objects')
for root, dirs, files in os.walk(objpath, topdown=True):
for i,dir in enumerate(dirs):
@@ -184,7 +206,9 @@ for root, dirs, files in os.walk(objpath, topdown=True):
embedded_py_files.append(os.path.join(root, f))
embedfile_hh = os.path.join(env['SRCDIR'], 'base/embedfile.hh')
-env.Depends('embedded_py.cc', embedfile_hh)
+env.Command('defines.py', None, MakeDefinesPyFile)
env.Command('embedded_py.py', embedded_py_files, MakeEmbeddedPyFile)
-env.Command('embedded_py.cc', ['importer.py', 'embedded_py.py'],
+env.Depends('embedded_py.cc', embedfile_hh)
+env.Command('embedded_py.cc',
+ ['string_importer.py', 'defines.py', 'embedded_py.py'],
MakePythonCFile)