SConscript revision 2623
16019Shines@cs.fsu.edu# -*- mode:python -*-
26019Shines@cs.fsu.edu
313168Smatt.horsnell@arm.com# Copyright (c) 2004-2005 The Regents of The University of Michigan
47100Sgblack@eecs.umich.edu# All rights reserved.
57100Sgblack@eecs.umich.edu#
67100Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
77100Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are
87100Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright
97100Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer;
107100Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright
117100Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the
127100Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution;
137100Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its
147100Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from
156019Shines@cs.fsu.edu# this software without specific prior written permission.
166019Shines@cs.fsu.edu#
176019Shines@cs.fsu.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
186019Shines@cs.fsu.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
196019Shines@cs.fsu.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
206019Shines@cs.fsu.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
216019Shines@cs.fsu.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
226019Shines@cs.fsu.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
236019Shines@cs.fsu.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
246019Shines@cs.fsu.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
256019Shines@cs.fsu.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
266019Shines@cs.fsu.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
276019Shines@cs.fsu.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
286019Shines@cs.fsu.edu
296019Shines@cs.fsu.eduimport os
306019Shines@cs.fsu.eduimport sys
316019Shines@cs.fsu.edufrom os.path import isdir
326019Shines@cs.fsu.edu
336019Shines@cs.fsu.edu# Import build environment variable from SConstruct.
346019Shines@cs.fsu.eduImport('env')
356019Shines@cs.fsu.edu
366019Shines@cs.fsu.edu###################################################
376019Shines@cs.fsu.edu#
386019Shines@cs.fsu.edu# Define needed sources.
396019Shines@cs.fsu.edu#
406019Shines@cs.fsu.edu###################################################
416019Shines@cs.fsu.edu
426757SAli.Saidi@ARM.com# Base sources used by all configurations.
436019Shines@cs.fsu.edubase_sources = Split('''
446019Shines@cs.fsu.edu	faults.cc
456019Shines@cs.fsu.edu	isa_traits.cc
466019Shines@cs.fsu.edu	''')
476019Shines@cs.fsu.edu
4811320Ssteve.reinhardt@amd.com# Full-system sources
496019Shines@cs.fsu.edufull_system_sources = Split('''
509022Sgblack@eecs.umich.edu	memory.cc
516019Shines@cs.fsu.edu	arguments.cc
5212640Sgiacomo.travaglini@arm.com	mips34k.cc
5310037SARM gem5 Developers	osfpal.cc
5410037SARM gem5 Developers	stacktrace.cc
557170Sgblack@eecs.umich.edu	vtophys.cc
566253Sgblack@eecs.umich.edu	''')
5710037SARM gem5 Developers
587202Sgblack@eecs.umich.edu# Syscall emulation (non-full-system) sources
5910037SARM gem5 Developerssyscall_emulation_sources = Split('''
606253Sgblack@eecs.umich.edu        linux/linux.cc
6110611SAndreas.Sandberg@ARM.com	linux/process.cc
626253Sgblack@eecs.umich.edu        process.cc
637396Sgblack@eecs.umich.edu	''')
6410037SARM gem5 Developers
6513168Smatt.horsnell@arm.com# Set up complete list of sources based on configuration.
668745Sgblack@eecs.umich.edusources = base_sources
677405SAli.Saidi@ARM.com
6810461SAndreas.Sandberg@ARM.comif env['FULL_SYSTEM']:
698782Sgblack@eecs.umich.edu    sources += full_system_sources
708782Sgblack@eecs.umich.eduelse:
718782Sgblack@eecs.umich.edu    sources += syscall_emulation_sources
7210810Sbr@bsdpad.com
7310810Sbr@bsdpad.com# Convert file names to SCons File objects.  This takes care of the
7410810Sbr@bsdpad.com# path relative to the top of the directory tree.
757259Sgblack@eecs.umich.edusources = [File(s) for s in sources]
768757Sgblack@eecs.umich.edu
7710461SAndreas.Sandberg@ARM.com# Add in files generated by the ISA description.
788782Sgblack@eecs.umich.eduisa_desc_files = env.ISADesc('isa/main.isa')
798757Sgblack@eecs.umich.edu# Only non-header files need to be compiled.
8012531Sandreas.sandberg@arm.comisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
818777Sgblack@eecs.umich.edusources += isa_desc_sources
828782Sgblack@eecs.umich.edu
838756Sgblack@eecs.umich.eduReturn('sources')
8410037SARM gem5 Developers