SConscript revision 2504
13918Ssaidi@eecs.umich.edu# -*- mode:python -*- 22632Sstever@eecs.umich.edu 32632Sstever@eecs.umich.edu# Copyright (c) 2004-2005 The Regents of The University of Michigan 42632Sstever@eecs.umich.edu# All rights reserved. 52632Sstever@eecs.umich.edu# 62632Sstever@eecs.umich.edu# Redistribution and use in source and binary forms, with or without 72632Sstever@eecs.umich.edu# modification, are permitted provided that the following conditions are 82632Sstever@eecs.umich.edu# met: redistributions of source code must retain the above copyright 92632Sstever@eecs.umich.edu# notice, this list of conditions and the following disclaimer; 102632Sstever@eecs.umich.edu# redistributions in binary form must reproduce the above copyright 112632Sstever@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the 122632Sstever@eecs.umich.edu# documentation and/or other materials provided with the distribution; 132632Sstever@eecs.umich.edu# neither the name of the copyright holders nor the names of its 142632Sstever@eecs.umich.edu# contributors may be used to endorse or promote products derived from 152632Sstever@eecs.umich.edu# this software without specific prior written permission. 162632Sstever@eecs.umich.edu# 172632Sstever@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 182632Sstever@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 192632Sstever@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 202632Sstever@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 212632Sstever@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 222632Sstever@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 232632Sstever@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 242632Sstever@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 252632Sstever@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 262632Sstever@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 272632Sstever@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 282632Sstever@eecs.umich.edu 292632Sstever@eecs.umich.eduimport os 302632Sstever@eecs.umich.eduimport sys 312022SN/Afrom os.path import isdir 322022SN/A 332022SN/A# Import build environment variable from SConstruct. 342022SN/AImport('env') 352022SN/A 362022SN/A################################################### 372022SN/A# 382022SN/A# Define needed sources. 392022SN/A# 402482SN/A################################################### 412022SN/A 422224SN/A# Base sources used by all configurations. 432224SN/Abase_sources = Split(''' 442516SN/A faults.cc 452516SN/A isa_traits.cc 462224SN/A ''') 472224SN/A 482224SN/A# Full-system sources 492022SN/Afull_system_sources = Split(''' 502224SN/A memory.cc 512469SN/A arguments.cc 522516SN/A mips34k.cc 532516SN/A osfpal.cc 542516SN/A stacktrace.cc 552516SN/A vtophys.cc 562516SN/A ''') 572516SN/A 582516SN/A# Syscall emulation (non-full-system) sources 592516SN/Asyscall_emulation_sources = Split(''' 602516SN/A linux_process.cc 612516SN/A process.cc 622516SN/A ''') 632516SN/A 642516SN/A# Set up complete list of sources based on configuration. 652516SN/Asources = base_sources 662516SN/A 672516SN/Aif env['FULL_SYSTEM']: 682516SN/A sources += full_system_sources 692516SN/Aelse: 703042Sgblack@eecs.umich.edu sources += syscall_emulation_sources 712516SN/A 722516SN/A# Convert file names to SCons File objects. This takes care of the 732516SN/A# path relative to the top of the directory tree. 742516SN/Asources = [File(s) for s in sources] 752516SN/A 762516SN/A# Add in files generated by the ISA description. 772022SN/Aisa_desc_files = env.ISADesc('isa/main.isa') 782482SN/A# Only non-header files need to be compiled. 792482SN/Aisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 802482SN/Asources += isa_desc_sources 812482SN/A 822516SN/AReturn('sources') 832482SN/A