SConscript revision 2623
1955SN/A# -*- mode:python -*-
2955SN/A
31762SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan
4955SN/A# All rights reserved.
5955SN/A#
6955SN/A# Redistribution and use in source and binary forms, with or without
7955SN/A# modification, are permitted provided that the following conditions are
8955SN/A# met: redistributions of source code must retain the above copyright
9955SN/A# notice, this list of conditions and the following disclaimer;
10955SN/A# redistributions in binary form must reproduce the above copyright
11955SN/A# notice, this list of conditions and the following disclaimer in the
12955SN/A# documentation and/or other materials provided with the distribution;
13955SN/A# neither the name of the copyright holders nor the names of its
14955SN/A# contributors may be used to endorse or promote products derived from
15955SN/A# this software without specific prior written permission.
16955SN/A#
17955SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18955SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19955SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20955SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21955SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22955SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23955SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24955SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25955SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26955SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27955SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282665Ssaidi@eecs.umich.edu
294762Snate@binkert.orgimport os
30955SN/Aimport sys
315522Snate@binkert.orgfrom os.path import isdir
326143Snate@binkert.org
334762Snate@binkert.org# Import build environment variable from SConstruct.
345522Snate@binkert.orgImport('env')
35955SN/A
365522Snate@binkert.org###################################################
3711974Sgabeblack@google.com#
38955SN/A# Define needed sources.
395522Snate@binkert.org#
404202Sbinkertn@umich.edu###################################################
415742Snate@binkert.org
42955SN/A# Base sources used by all configurations.
434381Sbinkertn@umich.edubase_sources = Split('''
444381Sbinkertn@umich.edu	faults.cc
4512246Sgabeblack@google.com	isa_traits.cc
4612246Sgabeblack@google.com	''')
478334Snate@binkert.org
48955SN/A# Full-system sources
49955SN/Afull_system_sources = Split('''
504202Sbinkertn@umich.edu	tlb.cc
51955SN/A	arguments.cc
524382Sbinkertn@umich.edu	ev5.cc
534382Sbinkertn@umich.edu	osfpal.cc
544382Sbinkertn@umich.edu	stacktrace.cc
556654Snate@binkert.org	vtophys.cc
565517Snate@binkert.org	''')
578614Sgblack@eecs.umich.edu
587674Snate@binkert.org# Syscall emulation (non-full-system) sources
596143Snate@binkert.orgsyscall_emulation_sources = Split('''
606143Snate@binkert.org	linux/linux.cc
616143Snate@binkert.org	linux/process.cc
6212302Sgabeblack@google.com	solaris/solaris.cc
6312302Sgabeblack@google.com	solaris/process.cc
6412302Sgabeblack@google.com	process.cc
6512302Sgabeblack@google.com	''')
6612302Sgabeblack@google.com
6712302Sgabeblack@google.comsources = base_sources
6812302Sgabeblack@google.com
6912302Sgabeblack@google.comif env['FULL_SYSTEM']:
7012302Sgabeblack@google.com    sources += full_system_sources
7112302Sgabeblack@google.comelse:
7212302Sgabeblack@google.com    sources += syscall_emulation_sources
7312302Sgabeblack@google.com
7412363Sgabeblack@google.com# Convert file names to SCons File objects.  This takes care of the
7512302Sgabeblack@google.com# path relative to the top of the directory tree.
7612302Sgabeblack@google.comsources = [File(s) for s in sources]
7712302Sgabeblack@google.com
7812363Sgabeblack@google.com# Add in files generated by the ISA description.
7912302Sgabeblack@google.comisa_desc_files = env.ISADesc('isa/main.isa')
8012302Sgabeblack@google.com# Only non-header files need to be compiled.
8112302Sgabeblack@google.comisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
8212302Sgabeblack@google.comsources += isa_desc_sources
8312302Sgabeblack@google.com
8412302Sgabeblack@google.comReturn('sources')
8512302Sgabeblack@google.com