SConscript revision 2155
16167SN/A# -*- mode:python -*-
26167SN/A
37077SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan
47077SN/A# All rights reserved.
58721SN/A#
68673SN/A# Redistribution and use in source and binary forms, with or without
78835SAli.Saidi@ARM.com# modification, are permitted provided that the following conditions are
88835SAli.Saidi@ARM.com# met: redistributions of source code must retain the above copyright
98835SAli.Saidi@ARM.com# notice, this list of conditions and the following disclaimer;
108835SAli.Saidi@ARM.com# redistributions in binary form must reproduce the above copyright
118721SN/A# notice, this list of conditions and the following disclaimer in the
128835SAli.Saidi@ARM.com# documentation and/or other materials provided with the distribution;
138835SAli.Saidi@ARM.com# neither the name of the copyright holders nor the names of its
148721SN/A# contributors may be used to endorse or promote products derived from
158721SN/A# this software without specific prior written permission.
168721SN/A#
178721SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
188721SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
198721SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
208721SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
218721SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
228721SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
238721SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
248673SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
257077SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
268673SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
277935SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
288835SAli.Saidi@ARM.com
298835SAli.Saidi@ARM.comimport os
308673SN/Aimport sys
318673SN/Afrom os.path import isdir
328673SN/A
337935SN/A# Import build environment variable from SConstruct.
348673SN/AImport('env')
357935SN/A
368673SN/A###################################################
378673SN/A#
387935SN/A# Define needed sources.
397935SN/A#
408673SN/A###################################################
418673SN/A
428673SN/A# Base sources used by all configurations.
437935SN/Abase_sources = Split('''
448673SN/A	faults.cc
458673SN/A	isa_traits.cc
468673SN/A	''')
476167SN/A
486167SN/A# Full-system sources
49full_system_sources = Split('''
50	memory.cc
51	arguments.cc
52	mips34k.cc
53	osfpal.cc
54	stacktrace.cc
55	vtophys.cc
56	''')
57
58# Syscall emulation (non-full-system) sources
59syscall_emulation_sources = Split('''
60	common_syscall_emul.cc
61	linux_process.cc
62	tru64_process.cc
63	''')
64
65# Set up complete list of sources based on configuration.
66sources = base_sources
67
68if env['FULL_SYSTEM']:
69    sources += full_system_sources
70else:
71    sources += syscall_emulation_sources
72
73# Convert file names to SCons File objects.  This takes care of the
74# path relative to the top of the directory tree.
75sources = [File(s) for s in sources]
76
77# Add in files generated by the ISA description.
78isa_desc_files = env.ISADesc('isa/main.isa')
79# Only non-header files need to be compiled.
80isa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
81sources += isa_desc_sources
82
83Return('sources')
84