summaryrefslogtreecommitdiff
path: root/src/python/SConscript
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2006-06-09 23:18:46 -0400
committerSteve Reinhardt <stever@eecs.umich.edu>2006-06-09 23:18:46 -0400
commit95019d0c6f1675f42d899f2899e06d3017088f25 (patch)
tree7618cd95da8299faff8dd682e088ee707cae6a7f /src/python/SConscript
parent6de5d73a999240f92f050393bb10028968275835 (diff)
parent29e34a739b991af8d8e1eafe75ecb0904c324dc8 (diff)
downloadgem5-95019d0c6f1675f42d899f2899e06d3017088f25.tar.xz
Merge vm1.(none):/home/stever/bk/newmem
into vm1.(none):/home/stever/bk/newmem-py src/python/m5/__init__.py: src/sim/syscall_emul.cc: Hand merge. --HG-- extra : convert_revision : e2542735323e648383c89382421d98a7d1d761bf
Diffstat (limited to 'src/python/SConscript')
-rw-r--r--src/python/SConscript28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/python/SConscript b/src/python/SConscript
index 5a787cfdf..7b0f591eb 100644
--- a/src/python/SConscript
+++ b/src/python/SConscript
@@ -38,11 +38,8 @@ def join(*args):
Import('env')
-# This SConscript is in charge of collecting .py files and generating a zip archive that is appended to the m5 binary.
-
-# Copy .py source files here (relative to src/python in the build
-# directory).
-pyzip_root = 'zip'
+# This SConscript is in charge of collecting .py files and generating
+# a zip archive that is appended to the m5 binary.
# List of files & directories to include in the zip file. To include
# a package, list only the root directory of the package, not any
@@ -58,7 +55,7 @@ pyzip_dep_files = []
# Add the specified package to the zip archive. Adds the directory to
# pyzip_files and all included .py files to pyzip_dep_files.
def addPkg(pkgdir):
- pyzip_files.append(join(pyzip_root, pkgdir))
+ pyzip_files.append(pkgdir)
origdir = os.getcwd()
srcdir = join(Dir('.').srcnode().abspath, pkgdir)
os.chdir(srcdir)
@@ -70,10 +67,7 @@ def addPkg(pkgdir):
for f in files:
if f.endswith('.py'):
- source = join(pkgdir, path, f)
- target = join(pyzip_root, source)
- pyzip_dep_files.append(target)
- env.CopyFile(target, source)
+ pyzip_dep_files.append(join(pkgdir, path, f))
os.chdir(origdir)
@@ -81,19 +75,25 @@ def addPkg(pkgdir):
# build_env flags.
def MakeDefinesPyFile(target, source, env):
f = file(str(target[0]), 'w')
- print >>f, "import __main__"
- print >>f, "__main__.m5_build_env = ",
+ print >>f, "m5_build_env = ",
print >>f, source[0]
f.close()
optionDict = dict([(opt, env[opt]) for opt in env.ExportOptions])
-env.Command('defines.py', Value(optionDict), MakeDefinesPyFile)
+env.Command('m5/defines.py', Value(optionDict), MakeDefinesPyFile)
# Now specify the packages & files for the zip archive.
addPkg('m5')
-pyzip_files.append('defines.py')
+pyzip_files.append('m5/defines.py')
pyzip_files.append(join(env['ROOT'], 'util/pbs/jobfile.py'))
+env.Command(['swig/main_wrap.cc', 'm5/main.py'],
+ 'swig/main.i',
+ '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
+ '-o ${TARGETS[0]} $SOURCES')
+
+pyzip_dep_files.append('m5/main.py')
+
# Action function to build the zip archive. Uses the PyZipFile module
# included in the standard Python library.
def buildPyZip(target, source, env):