SConscript revision 2155
113511Sgabeblack@google.com# -*- mode:python -*-
213511Sgabeblack@google.com
313511Sgabeblack@google.com# Copyright (c) 2004-2005 The Regents of The University of Michigan
413511Sgabeblack@google.com# All rights reserved.
513511Sgabeblack@google.com#
613511Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without
713511Sgabeblack@google.com# modification, are permitted provided that the following conditions are
813511Sgabeblack@google.com# met: redistributions of source code must retain the above copyright
913511Sgabeblack@google.com# notice, this list of conditions and the following disclaimer;
1013511Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright
1113511Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the
1213511Sgabeblack@google.com# documentation and/or other materials provided with the distribution;
1313511Sgabeblack@google.com# neither the name of the copyright holders nor the names of its
1413511Sgabeblack@google.com# contributors may be used to endorse or promote products derived from
1513511Sgabeblack@google.com# this software without specific prior written permission.
1613511Sgabeblack@google.com#
1713511Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1813511Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1913513Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2013513Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2113511Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2213513Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2313513Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2413511Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2513513Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2613511Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2713513Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2813513Sgabeblack@google.com
2913513Sgabeblack@google.comimport os
3013511Sgabeblack@google.comimport sys
3113513Sgabeblack@google.comfrom os.path import isdir
3213513Sgabeblack@google.com
3313513Sgabeblack@google.com# Import build environment variable from SConstruct.
3413513Sgabeblack@google.comImport('env')
3513513Sgabeblack@google.com
3613513Sgabeblack@google.com###################################################
3713513Sgabeblack@google.com#
3813513Sgabeblack@google.com# Define needed sources.
3913513Sgabeblack@google.com#
4013513Sgabeblack@google.com###################################################
4113513Sgabeblack@google.com
4213513Sgabeblack@google.com# Base sources used by all configurations.
4313513Sgabeblack@google.combase_sources = Split('''
4413513Sgabeblack@google.com	faults.cc
4513511Sgabeblack@google.com	isa_traits.cc
4613511Sgabeblack@google.com	''')
4713513Sgabeblack@google.com
4813513Sgabeblack@google.com# Full-system sources
4913511Sgabeblack@google.comfull_system_sources = Split('''
5013513Sgabeblack@google.com	memory.cc
5113513Sgabeblack@google.com	arguments.cc
5213513Sgabeblack@google.com	mips34k.cc
5313513Sgabeblack@google.com	osfpal.cc
5413511Sgabeblack@google.com	stacktrace.cc
5513511Sgabeblack@google.com	vtophys.cc
5613513Sgabeblack@google.com	''')
5713513Sgabeblack@google.com
5813511Sgabeblack@google.com# Syscall emulation (non-full-system) sources
5913513Sgabeblack@google.comsyscall_emulation_sources = Split('''
6013511Sgabeblack@google.com	common_syscall_emul.cc
6113511Sgabeblack@google.com	linux_process.cc
6213513Sgabeblack@google.com	tru64_process.cc
6313513Sgabeblack@google.com	''')
6413511Sgabeblack@google.com
6513513Sgabeblack@google.com# Set up complete list of sources based on configuration.
6613511Sgabeblack@google.comsources = base_sources
6713511Sgabeblack@google.com
6813513Sgabeblack@google.comif env['FULL_SYSTEM']:
6913513Sgabeblack@google.com    sources += full_system_sources
7013511Sgabeblack@google.comelse:
7113513Sgabeblack@google.com    sources += syscall_emulation_sources
7213513Sgabeblack@google.com
7313513Sgabeblack@google.com# Convert file names to SCons File objects.  This takes care of the
7413511Sgabeblack@google.com# path relative to the top of the directory tree.
7513513Sgabeblack@google.comsources = [File(s) for s in sources]
7613513Sgabeblack@google.com
7713513Sgabeblack@google.com# Add in files generated by the ISA description.
7813513Sgabeblack@google.comisa_desc_files = env.ISADesc('isa/main.isa')
7913511Sgabeblack@google.com# Only non-header files need to be compiled.
8013513Sgabeblack@google.comisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
8113513Sgabeblack@google.comsources += isa_desc_sources
8213511Sgabeblack@google.com
8313511Sgabeblack@google.comReturn('sources')
8413511Sgabeblack@google.com