sconscript

来自「M5,一个功能强大的多处理器系统模拟器.很多针对处理器架构,性能的研究都使用它作」· 代码 · 共 126 行

TXT
126
字号
# -*- mode:python -*-# Copyright (c) 2004, 2005# The Regents of The University of Michigan# All Rights Reserved## This code is part of the M5 simulator.## Permission is granted to use, copy, create derivative works and# redistribute this software and such derivative works for any# purpose, so long as the copyright notice above, this grant of# permission, and the disclaimer below appear in all copies made; and# so long as the name of The University of Michigan is not used in any# advertising or publicity pertaining to the use or distribution of# this software without specific, written prior authorization.## THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE# UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND# WITHOUT WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER# EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR# PURPOSE. THE REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE# LIABLE FOR ANY DAMAGES, INCLUDING DIRECT, SPECIAL, INDIRECT,# INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM# ARISING OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN# IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF SUCH# DAMAGES.## Authors: Nathan Binkertimport os, subprocessImport('env')elf_files = []def ElfFile(filename):    elf_files.append(File(filename))ElfFile('elf_begin.c')ElfFile('elf_cntl.c')ElfFile('elf_data.c')ElfFile('elf_end.c')ElfFile('elf_fill.c')ElfFile('elf_flag.c')ElfFile('elf_getarhdr.c')ElfFile('elf_getarsym.c')ElfFile('elf_getbase.c')ElfFile('elf_getident.c')ElfFile('elf_hash.c')ElfFile('elf_kind.c')ElfFile('elf_memory.c')ElfFile('elf_next.c')ElfFile('elf_phnum.c')ElfFile('elf_rand.c')ElfFile('elf_rawfile.c')ElfFile('elf_scn.c')ElfFile('elf_shnum.c')ElfFile('elf_shstrndx.c')ElfFile('elf_strptr.c')ElfFile('elf_update.c')ElfFile('elf_version.c')ElfFile('gelf_checksum.c')ElfFile('gelf_dyn.c')ElfFile('gelf_ehdr.c')ElfFile('gelf_fsize.c')ElfFile('gelf_getclass.c')ElfFile('gelf_phdr.c')ElfFile('gelf_rel.c')ElfFile('gelf_rela.c')ElfFile('gelf_shdr.c')ElfFile('gelf_sym.c')ElfFile('gelf_symshndx.c')ElfFile('gelf_xlate.c')ElfFile('libelf.c')ElfFile('libelf_align.c')ElfFile('libelf_allocate.c')ElfFile('libelf_ar.c')ElfFile('libelf_checksum.c')ElfFile('libelf_data.c')ElfFile('libelf_ehdr.c')ElfFile('libelf_extended.c')ElfFile('libelf_phdr.c')ElfFile('libelf_shdr.c')ElfFile('libelf_xlate.c')ElfFile('libelf_convert.c')ElfFile('libelf_fsize.c')ElfFile('libelf_msize.c')m4env = Environment(ENV=os.environ)if env.get('CC'):    m4env['CC'] = env['CC']if env.get('CXX'):    m4env['CXX'] = env['CXX']if env.get('OSX64bit'):    m4env.Append(CFLAGS='-arch x86_64')    m4env.Append(LINKFLAGS='-arch x86_64')# If we have gm4 use itif m4env.Detect('gm4'):    m4env['M4'] = 'gm4'# Check that m4 is availableimport SCons.Tool.m4if not SCons.Tool.m4.exists(m4env):   print "Error: Can't find version of M4 macro processor.  " + \         "Please install M4 and try again."   Exit(1)m4env.Append(M4FLAGS='-DSRCDIR=%s' % Dir('.').path)m4env['M4COM'] = '$M4 $M4FLAGS $SOURCES > $TARGET'm4env.M4(target=File('libelf_convert.c'),         source=[File('elf_types.m4'), File('libelf_convert.m4')])m4env.M4(target=File('libelf_fsize.c'),         source=[File('elf_types.m4'), File('libelf_fsize.m4')])m4env.M4(target=File('libelf_msize.c'),         source=[File('elf_types.m4'), File('libelf_msize.m4')])m4env.Library('elf', elf_files)env.Append(CPPPATH=Dir('.'))env.Append(LIBS=['elf'])env.Append(LIBPATH=[Dir('.')])

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?