SConscript revision 2665
12023SN/A# -*- mode:python -*-
22023SN/A
32023SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan
42023SN/A# All rights reserved.
52023SN/A#
62023SN/A# Redistribution and use in source and binary forms, with or without
72023SN/A# modification, are permitted provided that the following conditions are
82023SN/A# met: redistributions of source code must retain the above copyright
92023SN/A# notice, this list of conditions and the following disclaimer;
102023SN/A# redistributions in binary form must reproduce the above copyright
112023SN/A# notice, this list of conditions and the following disclaimer in the
122023SN/A# documentation and/or other materials provided with the distribution;
132023SN/A# neither the name of the copyright holders nor the names of its
142023SN/A# contributors may be used to endorse or promote products derived from
152023SN/A# this software without specific prior written permission.
162023SN/A#
172023SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
182023SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
192023SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
202023SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
212023SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
222023SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
232023SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
242023SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
252023SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
262023SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
272023SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282665Ssaidi@eecs.umich.edu#
292665Ssaidi@eecs.umich.edu# Authors: Gabe Black
302665Ssaidi@eecs.umich.edu#          Steve Reinhardt
312023SN/A
324202Sbinkertn@umich.eduimport os
332023SN/Aimport sys
344202Sbinkertn@umich.edufrom os.path import isdir
354997Sgblack@eecs.umich.edu
364202Sbinkertn@umich.edu# This file defines how to build a particular configuration of M5
378780Sgblack@eecs.umich.edu# based on variable settings in the 'env' build environment.
388780Sgblack@eecs.umich.edu
398745Sgblack@eecs.umich.edu# Import build environment variable from SConstruct.
404997Sgblack@eecs.umich.eduImport('env')
416313Sgblack@eecs.umich.edu
428777Sgblack@eecs.umich.edu###################################################
438780Sgblack@eecs.umich.edu#
448780Sgblack@eecs.umich.edu# Define needed sources.
458780Sgblack@eecs.umich.edu#
468777Sgblack@eecs.umich.edu###################################################
474997Sgblack@eecs.umich.edu
488780Sgblack@eecs.umich.edu# Base sources used by all configurations.
496327Sgblack@eecs.umich.edubase_sources = Split('''
504202Sbinkertn@umich.edu	faults.cc
518777Sgblack@eecs.umich.edu	isa_traits.cc
528780Sgblack@eecs.umich.edu	''')
534997Sgblack@eecs.umich.edu
548780Sgblack@eecs.umich.edu# Full-system sources
558780Sgblack@eecs.umich.edufull_system_sources = Split('''
568780Sgblack@eecs.umich.edu	tlb.cc
574826Ssaidi@eecs.umich.edu	arguments.cc
588755Sgblack@eecs.umich.edu	ev5.cc
592023SN/A	osfpal.cc
608745Sgblack@eecs.umich.edu	stacktrace.cc
618780Sgblack@eecs.umich.edu	vtophys.cc
624997Sgblack@eecs.umich.edu	system.cc
634997Sgblack@eecs.umich.edu	freebsd/system.cc
642023SN/A	linux/system.cc
654202Sbinkertn@umich.edu	tru64/system.cc
664202Sbinkertn@umich.edu	''')
674202Sbinkertn@umich.edu
684202Sbinkertn@umich.edu
694202Sbinkertn@umich.edu# Syscall emulation (non-full-system) sources
704202Sbinkertn@umich.edusyscall_emulation_sources = Split('''
71        linux/linux.cc
72	linux/process.cc
73        tru64/tru64.cc
74	tru64/process.cc
75	process.cc
76	''')
77
78# Set up complete list of sources based on configuration.
79sources = base_sources
80
81if env['FULL_SYSTEM']:
82    sources += full_system_sources
83else:
84    sources += syscall_emulation_sources
85
86# Convert file names to SCons File objects.  This takes care of the
87# path relative to the top of the directory tree.
88sources = [File(s) for s in sources]
89
90# Add in files generated by the ISA description.
91isa_desc_files = env.ISADesc('isa/main.isa')
92# Only non-header files need to be compiled.
93isa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
94sources += isa_desc_sources
95
96Return('sources')
97