SConscript revision 3817
112837Sgabeblack@google.com# -*- mode:python -*-
212837Sgabeblack@google.com
312837Sgabeblack@google.com# Copyright (c) 2004-2005 The Regents of The University of Michigan
412837Sgabeblack@google.com# All rights reserved.
512837Sgabeblack@google.com#
612837Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without
712837Sgabeblack@google.com# modification, are permitted provided that the following conditions are
812837Sgabeblack@google.com# met: redistributions of source code must retain the above copyright
912837Sgabeblack@google.com# notice, this list of conditions and the following disclaimer;
1012837Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright
1112837Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the
1212837Sgabeblack@google.com# documentation and/or other materials provided with the distribution;
1312837Sgabeblack@google.com# neither the name of the copyright holders nor the names of its
1412837Sgabeblack@google.com# contributors may be used to endorse or promote products derived from
1512837Sgabeblack@google.com# this software without specific prior written permission.
1612837Sgabeblack@google.com#
1712837Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1812837Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1912837Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2012837Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2112837Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2212837Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2312837Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2412837Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2512837Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2612837Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2712837Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2812837Sgabeblack@google.com#
2912837Sgabeblack@google.com# Authors: Gabe Black
3012837Sgabeblack@google.com#          Steve Reinhardt
3112837Sgabeblack@google.com
3212837Sgabeblack@google.comimport os
3312837Sgabeblack@google.comimport sys
3412863Sgabeblack@google.comfrom os.path import isdir
3512837Sgabeblack@google.com
3612837Sgabeblack@google.com# Import build environment variable from SConstruct.
3712837Sgabeblack@google.comImport('env')
3812837Sgabeblack@google.com
3912837Sgabeblack@google.com###################################################
4012837Sgabeblack@google.com#
4112837Sgabeblack@google.com# Define needed sources.
4212837Sgabeblack@google.com#
4312837Sgabeblack@google.com###################################################
4412837Sgabeblack@google.com
4512838Sgabeblack@google.com# Base sources used by all configurations.
4612837Sgabeblack@google.combase_sources = Split('''
4712837Sgabeblack@google.com	asi.cc
4812940Sgabeblack@google.com	faults.cc
4912839Sgabeblack@google.com	floatregfile.cc
5012837Sgabeblack@google.com	intregfile.cc
51	miscregfile.cc
52	regfile.cc
53	''')
54
55# Full-system sources
56full_system_sources = Split('''
57	arguments.cc
58	remote_gdb.cc
59        pagetable.cc
60	stacktrace.cc
61	system.cc
62	tlb.cc
63        ua2005.cc
64	vtophys.cc
65	''')
66
67# Syscall emulation (non-full-system) sources
68syscall_emulation_sources = Split('''
69	linux/linux.cc
70	linux/process.cc
71	process.cc
72	solaris/process.cc
73	solaris/solaris.cc
74	''')
75
76sources = base_sources
77
78if env['FULL_SYSTEM']:
79    sources += full_system_sources
80else:
81    sources += syscall_emulation_sources
82
83# Convert file names to SCons File objects.  This takes care of the
84# path relative to the top of the directory tree.
85sources = [File(s) for s in sources]
86
87# Add in files generated by the ISA description.
88isa_desc_files = env.ISADesc('isa/main.isa')
89# Only non-header files need to be compiled.
90isa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
91sources += isa_desc_sources
92
93Return('sources')
94