SConscript (2763:c3741c707d53) SConscript (2889:9e367e03d656)
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 61 unchanged lines hidden (view full) ---

70 pyzip_dep_files.append(join(pkgdir, path, f))
71
72 os.chdir(origdir)
73
74# Generate Python file that contains a dict specifying the current
75# build_env flags.
76def MakeDefinesPyFile(target, source, env):
77 f = file(str(target[0]), 'w')
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 61 unchanged lines hidden (view full) ---

70 pyzip_dep_files.append(join(pkgdir, path, f))
71
72 os.chdir(origdir)
73
74# Generate Python file that contains a dict specifying the current
75# build_env flags.
76def MakeDefinesPyFile(target, source, env):
77 f = file(str(target[0]), 'w')
78 print >>f, "m5_build_env = ",
79 print >>f, source[0]
78 print >>f, "m5_build_env = ", source[0]
80 f.close()
81
82optionDict = dict([(opt, env[opt]) for opt in env.ExportOptions])
83env.Command('m5/defines.py', Value(optionDict), MakeDefinesPyFile)
84
79 f.close()
80
81optionDict = dict([(opt, env[opt]) for opt in env.ExportOptions])
82env.Command('m5/defines.py', Value(optionDict), MakeDefinesPyFile)
83
84def MakeInfoPyFile(target, source, env):
85 f = file(str(target[0]), 'w')
86 for src in source:
87 data = ''.join(file(src.srcnode().abspath, 'r').xreadlines())
88 print >>f, "%s = %s" % (src, repr(data))
89 f.close()
90
91env.Command('m5/info.py',
92 [ '#/AUTHORS', '#/LICENSE', '#/README', '#/RELEASE_NOTES' ],
93 MakeInfoPyFile)
94
85# Now specify the packages & files for the zip archive.
86addPkg('m5')
87pyzip_files.append('m5/defines.py')
95# Now specify the packages & files for the zip archive.
96addPkg('m5')
97pyzip_files.append('m5/defines.py')
98pyzip_files.append('m5/info.py')
88pyzip_files.append(join(env['ROOT'], 'util/pbs/jobfile.py'))
89
90env.Command(['swig/cc_main_wrap.cc', 'm5/cc_main.py'],
91 'swig/cc_main.i',
92 '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
93 '-o ${TARGETS[0]} $SOURCES')
94
95pyzip_dep_files.append('m5/cc_main.py')
96
97# Action function to build the zip archive. Uses the PyZipFile module
98# included in the standard Python library.
99def buildPyZip(target, source, env):
100 pzf = PyZipFile(str(target[0]), 'w')
101 for s in source:
102 pzf.writepy(str(s))
103
104# Add the zip file target to the environment.
105env.Command('m5py.zip', pyzip_files, buildPyZip)
106env.Depends('m5py.zip', pyzip_dep_files)
99pyzip_files.append(join(env['ROOT'], 'util/pbs/jobfile.py'))
100
101env.Command(['swig/cc_main_wrap.cc', 'm5/cc_main.py'],
102 'swig/cc_main.i',
103 '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
104 '-o ${TARGETS[0]} $SOURCES')
105
106pyzip_dep_files.append('m5/cc_main.py')
107
108# Action function to build the zip archive. Uses the PyZipFile module
109# included in the standard Python library.
110def buildPyZip(target, source, env):
111 pzf = PyZipFile(str(target[0]), 'w')
112 for s in source:
113 pzf.writepy(str(s))
114
115# Add the zip file target to the environment.
116env.Command('m5py.zip', pyzip_files, buildPyZip)
117env.Depends('m5py.zip', pyzip_dep_files)