SConscript revision 2665
12929Sktlim@umich.edu# -*- mode:python -*-
22929Sktlim@umich.edu
32932Sktlim@umich.edu# Copyright (c) 2004-2005 The Regents of The University of Michigan
42929Sktlim@umich.edu# All rights reserved.
52929Sktlim@umich.edu#
62929Sktlim@umich.edu# Redistribution and use in source and binary forms, with or without
72929Sktlim@umich.edu# modification, are permitted provided that the following conditions are
82929Sktlim@umich.edu# met: redistributions of source code must retain the above copyright
92929Sktlim@umich.edu# notice, this list of conditions and the following disclaimer;
102929Sktlim@umich.edu# redistributions in binary form must reproduce the above copyright
112929Sktlim@umich.edu# notice, this list of conditions and the following disclaimer in the
122929Sktlim@umich.edu# documentation and/or other materials provided with the distribution;
132929Sktlim@umich.edu# neither the name of the copyright holders nor the names of its
142929Sktlim@umich.edu# contributors may be used to endorse or promote products derived from
152929Sktlim@umich.edu# this software without specific prior written permission.
162929Sktlim@umich.edu#
172929Sktlim@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
182929Sktlim@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
192929Sktlim@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
202929Sktlim@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
212929Sktlim@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
222929Sktlim@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
232929Sktlim@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
242929Sktlim@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
252929Sktlim@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
262929Sktlim@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
272929Sktlim@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282932Sktlim@umich.edu#
292932Sktlim@umich.edu# Authors: Gabe Black
302932Sktlim@umich.edu#          Steve Reinhardt
312929Sktlim@umich.edu
326007Ssteve.reinhardt@amd.comimport os
337735SAli.Saidi@ARM.comimport sys
342929Sktlim@umich.edufrom os.path import isdir
352929Sktlim@umich.edu
362929Sktlim@umich.edu# Import build environment variable from SConstruct.
372929Sktlim@umich.eduImport('env')
382929Sktlim@umich.edu
392929Sktlim@umich.edu###################################################
402929Sktlim@umich.edu#
418947Sandreas.hansson@arm.com# Define needed sources.
428947Sandreas.hansson@arm.com#
438947Sandreas.hansson@arm.com###################################################
442929Sktlim@umich.edu
452929Sktlim@umich.edu# Base sources used by all configurations.
462929Sktlim@umich.edubase_sources = Split('''
472929Sktlim@umich.edu	faults.cc
482929Sktlim@umich.edu	isa_traits.cc
492929Sktlim@umich.edu	''')
506007Ssteve.reinhardt@amd.com
516007Ssteve.reinhardt@amd.com# Full-system sources
526007Ssteve.reinhardt@amd.comfull_system_sources = Split('''
536007Ssteve.reinhardt@amd.com	memory.cc
546007Ssteve.reinhardt@amd.com	arguments.cc
556007Ssteve.reinhardt@amd.com	mips34k.cc
566007Ssteve.reinhardt@amd.com	osfpal.cc
576007Ssteve.reinhardt@amd.com	stacktrace.cc
586007Ssteve.reinhardt@amd.com	vtophys.cc
596007Ssteve.reinhardt@amd.com	''')
606007Ssteve.reinhardt@amd.com
616007Ssteve.reinhardt@amd.com# Syscall emulation (non-full-system) sources
626007Ssteve.reinhardt@amd.comsyscall_emulation_sources = Split('''
636007Ssteve.reinhardt@amd.com        linux/linux.cc
646007Ssteve.reinhardt@amd.com	linux/process.cc
656007Ssteve.reinhardt@amd.com        process.cc
669435SAndreas.Sandberg@ARM.com	''')
679435SAndreas.Sandberg@ARM.com
689435SAndreas.Sandberg@ARM.com# Set up complete list of sources based on configuration.
696007Ssteve.reinhardt@amd.comsources = base_sources
706007Ssteve.reinhardt@amd.com
716007Ssteve.reinhardt@amd.comif env['FULL_SYSTEM']:
726007Ssteve.reinhardt@amd.com    sources += full_system_sources
736007Ssteve.reinhardt@amd.comelse:
746007Ssteve.reinhardt@amd.com    sources += syscall_emulation_sources
756007Ssteve.reinhardt@amd.com
766007Ssteve.reinhardt@amd.com# Convert file names to SCons File objects.  This takes care of the
776007Ssteve.reinhardt@amd.com# path relative to the top of the directory tree.
786007Ssteve.reinhardt@amd.comsources = [File(s) for s in sources]
792929Sktlim@umich.edu
802929Sktlim@umich.edu# Add in files generated by the ISA description.
812929Sktlim@umich.eduisa_desc_files = env.ISADesc('isa/main.isa')
826007Ssteve.reinhardt@amd.com# Only non-header files need to be compiled.
836007Ssteve.reinhardt@amd.comisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
846007Ssteve.reinhardt@amd.comsources += isa_desc_sources
856007Ssteve.reinhardt@amd.com
866007Ssteve.reinhardt@amd.comReturn('sources')
876007Ssteve.reinhardt@amd.com