SConscript revision 2152
111507SCurtis.Dunham@arm.com# -*- mode:python -*-
211507SCurtis.Dunham@arm.com
311570SCurtis.Dunham@arm.com# Copyright (c) 2004-2005 The Regents of The University of Michigan
411570SCurtis.Dunham@arm.com# All rights reserved.
511570SCurtis.Dunham@arm.com#
611507SCurtis.Dunham@arm.com# Redistribution and use in source and binary forms, with or without
711570SCurtis.Dunham@arm.com# modification, are permitted provided that the following conditions are
811570SCurtis.Dunham@arm.com# met: redistributions of source code must retain the above copyright
911570SCurtis.Dunham@arm.com# notice, this list of conditions and the following disclaimer;
1011570SCurtis.Dunham@arm.com# redistributions in binary form must reproduce the above copyright
1111570SCurtis.Dunham@arm.com# notice, this list of conditions and the following disclaimer in the
1211507SCurtis.Dunham@arm.com# documentation and/or other materials provided with the distribution;
1311507SCurtis.Dunham@arm.com# neither the name of the copyright holders nor the names of its
1411507SCurtis.Dunham@arm.com# contributors may be used to endorse or promote products derived from
1511507SCurtis.Dunham@arm.com# this software without specific prior written permission.
1611570SCurtis.Dunham@arm.com#
1711507SCurtis.Dunham@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1811570SCurtis.Dunham@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1911570SCurtis.Dunham@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2011507SCurtis.Dunham@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2111507SCurtis.Dunham@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2211507SCurtis.Dunham@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2311570SCurtis.Dunham@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2411570SCurtis.Dunham@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2511570SCurtis.Dunham@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2611570SCurtis.Dunham@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2711570SCurtis.Dunham@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2811570SCurtis.Dunham@arm.com
2911570SCurtis.Dunham@arm.comimport os
3011570SCurtis.Dunham@arm.comimport sys
3111570SCurtis.Dunham@arm.comfrom os.path import isdir
3211570SCurtis.Dunham@arm.com
3311570SCurtis.Dunham@arm.com# Import build environment variable from SConstruct.
3411507SCurtis.Dunham@arm.comImport('env')
3511570SCurtis.Dunham@arm.com
3611507SCurtis.Dunham@arm.com###################################################
3711570SCurtis.Dunham@arm.com#
3811507SCurtis.Dunham@arm.com# Define needed sources.
3911507SCurtis.Dunham@arm.com#
4011570SCurtis.Dunham@arm.com###################################################
4111507SCurtis.Dunham@arm.com
4211507SCurtis.Dunham@arm.com# Base sources used by all configurations.
4311507SCurtis.Dunham@arm.combase_sources = Split('''
4411507SCurtis.Dunham@arm.com	faults.cc
4511507SCurtis.Dunham@arm.com	isa_traits.cc
4611570SCurtis.Dunham@arm.com	''')
4711507SCurtis.Dunham@arm.com
4811507SCurtis.Dunham@arm.com# Full-system sources
4911507SCurtis.Dunham@arm.comfull_system_sources = Split('''
5011507SCurtis.Dunham@arm.com	alpha_memory.cc
5111507SCurtis.Dunham@arm.com	arguments.cc
5211507SCurtis.Dunham@arm.com	ev5.cc
5311507SCurtis.Dunham@arm.com	osfpal.cc
5411507SCurtis.Dunham@arm.com	stacktrace.cc
5511507SCurtis.Dunham@arm.com	vtophys.cc
5611507SCurtis.Dunham@arm.com	''')
5711507SCurtis.Dunham@arm.com
5811507SCurtis.Dunham@arm.com# Syscall emulation (non-full-system) sources
5911507SCurtis.Dunham@arm.comsyscall_emulation_sources = Split('''
6011507SCurtis.Dunham@arm.com	alpha_common_syscall_emul.cc
6111507SCurtis.Dunham@arm.com	alpha_linux_process.cc
6211507SCurtis.Dunham@arm.com	alpha_tru64_process.cc
6311507SCurtis.Dunham@arm.com	''')
6411507SCurtis.Dunham@arm.com
6511507SCurtis.Dunham@arm.comsources = base_sources
6611507SCurtis.Dunham@arm.com
6711507SCurtis.Dunham@arm.comif env['FULL_SYSTEM']:
6811507SCurtis.Dunham@arm.com    sources += full_system_sources
6911507SCurtis.Dunham@arm.comelse:
7011507SCurtis.Dunham@arm.com    sources += syscall_emulation_sources
7111507SCurtis.Dunham@arm.com
7211507SCurtis.Dunham@arm.com# Convert file names to SCons File objects.  This takes care of the
7311507SCurtis.Dunham@arm.com# path relative to the top of the directory tree.
7411507SCurtis.Dunham@arm.comsources = [File(s) for s in sources]
7511507SCurtis.Dunham@arm.com
7611507SCurtis.Dunham@arm.com# Add in files generated by the ISA description.
7711507SCurtis.Dunham@arm.comisa_desc_files = env.ISADesc('isa/main.isa')
7811507SCurtis.Dunham@arm.com# Only non-header files need to be compiled.
7911570SCurtis.Dunham@arm.comisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
8011507SCurtis.Dunham@arm.comsources += isa_desc_sources
8111507SCurtis.Dunham@arm.com
8211507SCurtis.Dunham@arm.comReturn('sources')
8311507SCurtis.Dunham@arm.com