diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2005-03-14 15:38:26 -0500 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2005-03-14 15:38:26 -0500 |
commit | 76e6dd01ae4a534adad1d34398fefc819771a781 (patch) | |
tree | a678ca355625b9199cbb0f64ca42d247e520accb /python/SConscript | |
parent | c1f5b983f0c8cece7a8387b05b40889c9520fb39 (diff) | |
parent | bc2923f78d739ad5ff42dee402c5ba27c02004f1 (diff) | |
download | gem5-76e6dd01ae4a534adad1d34398fefc819771a781.tar.xz |
Merge zizzer:/bk/m5 into zeep.eecs.umich.edu:/z/saidi/work/m5
--HG--
extra : convert_revision : 9eed6f31249ff099464044b32b882b3cc041b57a
Diffstat (limited to 'python/SConscript')
-rw-r--r-- | python/SConscript | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/python/SConscript b/python/SConscript index 81bc52286..9c15c6d50 100644 --- a/python/SConscript +++ b/python/SConscript @@ -26,7 +26,11 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import os, os.path, re +import os, os.path, re, sys + +Import('env') + +import m5scons def WriteEmbeddedPyFile(target, source, path, name, ext, filename): if isinstance(source, str): @@ -89,7 +93,6 @@ def splitpath(path): path.insert(0, base) return path, file -Import('env') def MakeEmbeddedPyFile(target, source, env): target = file(str(target[0]), 'w') @@ -145,27 +148,11 @@ def MakeEmbeddedPyFile(target, source, env): WriteEmbeddedPyFile(target, pyfile, path, name, ext, filename) def MakeDefinesPyFile(target, source, env): - target = file(str(target[0]), 'w') - - print >>target, "import os" - 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, "os.environ['%s'] = '%s'" % (key, val) - - elif isinstance(defines, dict): - for key,val in defines.iteritems(): - print >>target, "os.environ['%s'] = '%s'" % (key, val) - else: - panic("invalid type for defines: %s" % type(defines)) + f = file(str(target[0]), 'w') + print >>f, "import __main__" + print >>f, "__main__.m5_build_env = ", + print >>f, m5scons.flatten_defines(env['CPPDEFINES']) + f.close() CFileCounter = 0 def MakePythonCFile(target, source, env): @@ -193,8 +180,10 @@ EmbedMap %(name)s("%(fname)s", /* namespace */ } ''' -embedded_py_files = [ 'mpy_importer.py', '../util/pbs/jobfile.py' ] -objpath = os.path.join(env['SRCDIR'], 'python/m5') +# base list of .py files to embed +embedded_py_files = [ '../util/pbs/jobfile.py' ] +# add all .py and .mpy files in python/m5 +objpath = os.path.join(env['SRCDIR'], 'python', 'm5') for root, dirs, files in os.walk(objpath, topdown=True): for i,dir in enumerate(dirs): if dir == 'SCCS': |