SConscript revision 2623
112866Sgabeblack@google.com# -*- mode:python -*-
212866Sgabeblack@google.com
312866Sgabeblack@google.com# Copyright (c) 2004-2005 The Regents of The University of Michigan
412866Sgabeblack@google.com# All rights reserved.
512866Sgabeblack@google.com#
612866Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without
712866Sgabeblack@google.com# modification, are permitted provided that the following conditions are
812866Sgabeblack@google.com# met: redistributions of source code must retain the above copyright
912866Sgabeblack@google.com# notice, this list of conditions and the following disclaimer;
1012866Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright
1112866Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the
1212866Sgabeblack@google.com# documentation and/or other materials provided with the distribution;
1312866Sgabeblack@google.com# neither the name of the copyright holders nor the names of its
1412866Sgabeblack@google.com# contributors may be used to endorse or promote products derived from
1512866Sgabeblack@google.com# this software without specific prior written permission.
1612866Sgabeblack@google.com#
1712866Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1812866Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1912866Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2012866Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2112866Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2212866Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2312866Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2412866Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2512866Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2612866Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2712866Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2812866Sgabeblack@google.com
2912866Sgabeblack@google.comimport os
3012866Sgabeblack@google.comimport sys
3112866Sgabeblack@google.comfrom os.path import isdir
3212866Sgabeblack@google.com
3312866Sgabeblack@google.com# Import build environment variable from SConstruct.
3412866Sgabeblack@google.comImport('env')
3512866Sgabeblack@google.com
3612866Sgabeblack@google.com###################################################
3712866Sgabeblack@google.com#
3812866Sgabeblack@google.com# Define needed sources.
3912866Sgabeblack@google.com#
4012866Sgabeblack@google.com###################################################
4112866Sgabeblack@google.com
4212866Sgabeblack@google.com# Base sources used by all configurations.
4312866Sgabeblack@google.combase_sources = Split('''
4412866Sgabeblack@google.com	faults.cc
4512866Sgabeblack@google.com	isa_traits.cc
4612866Sgabeblack@google.com	''')
4712866Sgabeblack@google.com
4812866Sgabeblack@google.com# Full-system sources
4912866Sgabeblack@google.comfull_system_sources = Split('''
5012866Sgabeblack@google.com	tlb.cc
5112866Sgabeblack@google.com	arguments.cc
5212866Sgabeblack@google.com	ev5.cc
5312866Sgabeblack@google.com	osfpal.cc
5412866Sgabeblack@google.com	stacktrace.cc
5512866Sgabeblack@google.com	vtophys.cc
5612866Sgabeblack@google.com	''')
5712866Sgabeblack@google.com
5812866Sgabeblack@google.com# Syscall emulation (non-full-system) sources
5912866Sgabeblack@google.comsyscall_emulation_sources = Split('''
6012866Sgabeblack@google.com	linux/linux.cc
6112866Sgabeblack@google.com	linux/process.cc
6212866Sgabeblack@google.com	solaris/solaris.cc
6312866Sgabeblack@google.com	solaris/process.cc
6412866Sgabeblack@google.com	process.cc
6512866Sgabeblack@google.com	''')
6612866Sgabeblack@google.com
6712866Sgabeblack@google.comsources = base_sources
6812866Sgabeblack@google.com
6912866Sgabeblack@google.comif env['FULL_SYSTEM']:
7012866Sgabeblack@google.com    sources += full_system_sources
7112866Sgabeblack@google.comelse:
7212866Sgabeblack@google.com    sources += syscall_emulation_sources
7312866Sgabeblack@google.com
7412866Sgabeblack@google.com# Convert file names to SCons File objects.  This takes care of the
7512866Sgabeblack@google.com# path relative to the top of the directory tree.
7612866Sgabeblack@google.comsources = [File(s) for s in sources]
7712866Sgabeblack@google.com
7812866Sgabeblack@google.com# Add in files generated by the ISA description.
7912866Sgabeblack@google.comisa_desc_files = env.ISADesc('isa/main.isa')
8012866Sgabeblack@google.com# Only non-header files need to be compiled.
8112866Sgabeblack@google.comisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
8212866Sgabeblack@google.comsources += isa_desc_sources
8312866Sgabeblack@google.com
8412866Sgabeblack@google.comReturn('sources')
8512866Sgabeblack@google.com