SConscript (3645:2bf1f7c69254) | SConscript (3869:14fa2366b6a9) |
---|---|
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 --- 84 unchanged lines hidden (view full) --- 93 MakeInfoPyFile) 94 95# Now specify the packages & files for the zip archive. 96addPkg('m5') 97pyzip_files.append('m5/defines.py') 98pyzip_files.append('m5/info.py') 99pyzip_files.append(join(env['ROOT'], 'util/pbs/jobfile.py')) 100 | 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 --- 84 unchanged lines hidden (view full) --- 93 MakeInfoPyFile) 94 95# Now specify the packages & files for the zip archive. 96addPkg('m5') 97pyzip_files.append('m5/defines.py') 98pyzip_files.append('m5/info.py') 99pyzip_files.append(join(env['ROOT'], 'util/pbs/jobfile.py')) 100 |
101env.Command(['swig/debug_wrap.cc', 'm5/internal/debug.py'], 102 'swig/debug.i', 103 '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} ' 104 '-o ${TARGETS[0]} $SOURCES') | 101def swig_it(basename): 102 env.Command(['swig/%s_wrap.cc' % basename, 'm5/internal/%s.py' % basename], 103 'swig/%s.i' % basename, 104 '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} ' 105 '-o ${TARGETS[0]} $SOURCES') 106 pyzip_dep_files.append('m5/internal/%s.py' % basename) |
105 | 107 |
106env.Command(['swig/main_wrap.cc', 'm5/internal/main.py'], 107 'swig/main.i', 108 '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} ' 109 '-o ${TARGETS[0]} $SOURCES') | 108swig_it('main') 109swig_it('debug') |
110 | 110 |
111pyzip_dep_files.append('m5/internal/debug.py') 112pyzip_dep_files.append('m5/internal/main.py') 113 | |
114# Action function to build the zip archive. Uses the PyZipFile module 115# included in the standard Python library. 116def buildPyZip(target, source, env): 117 pzf = PyZipFile(str(target[0]), 'w') 118 for s in source: 119 pzf.writepy(str(s)) 120 121# Add the zip file target to the environment. 122env.Command('m5py.zip', pyzip_files, buildPyZip) 123env.Depends('m5py.zip', pyzip_dep_files) | 111# Action function to build the zip archive. Uses the PyZipFile module 112# included in the standard Python library. 113def buildPyZip(target, source, env): 114 pzf = PyZipFile(str(target[0]), 'w') 115 for s in source: 116 pzf.writepy(str(s)) 117 118# Add the zip file target to the environment. 119env.Command('m5py.zip', pyzip_files, buildPyZip) 120env.Depends('m5py.zip', pyzip_dep_files) |