SConscript revision 2458
12139SN/A# -*- mode:python -*-
22139SN/A
32139SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan
42139SN/A# All rights reserved.
52139SN/A#
62139SN/A# Redistribution and use in source and binary forms, with or without
72139SN/A# modification, are permitted provided that the following conditions are
82139SN/A# met: redistributions of source code must retain the above copyright
92139SN/A# notice, this list of conditions and the following disclaimer;
102139SN/A# redistributions in binary form must reproduce the above copyright
112139SN/A# notice, this list of conditions and the following disclaimer in the
122139SN/A# documentation and/or other materials provided with the distribution;
132139SN/A# neither the name of the copyright holders nor the names of its
142139SN/A# contributors may be used to endorse or promote products derived from
152139SN/A# this software without specific prior written permission.
162139SN/A#
172139SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
182139SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
192139SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
202139SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
212139SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
222139SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
232139SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
242139SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
252139SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
262139SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
272139SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282139SN/A
292139SN/Aimport os
302139SN/Aimport sys
312139SN/Afrom os.path import isdir
322139SN/A
332139SN/A# Import build environment variable from SConstruct.
342152SN/AImport('env')
352152SN/A
362152SN/A###################################################
372152SN/A#
382139SN/A# Define needed sources.
392139SN/A#
402139SN/A###################################################
412139SN/A
422139SN/A# Base sources used by all configurations.
432152SN/Abase_sources = Split('''
442152SN/A	faults.cc
452139SN/A	isa_traits.cc
462139SN/A	''')
472139SN/A
482439SN/A# Full-system sources
492439SN/Afull_system_sources = Split('''
502439SN/A	tlb.cc
512139SN/A	arguments.cc
522439SN/A	ev5.cc
532460SN/A	osfpal.cc
542439SN/A	stacktrace.cc
552171SN/A	vtophys.cc
562439SN/A	''')
572439SN/A
582170SN/A# Syscall emulation (non-full-system) sources
592139SN/Asyscall_emulation_sources = Split('''
602139SN/A	linux/process.cc
612139SN/A	process.cc
622139SN/A	''')
632139SN/A
642139SN/Asources = base_sources
652139SN/A
662139SN/Aif env['FULL_SYSTEM']:
672139SN/A    sources += full_system_sources
682139SN/Aelse:
692139SN/A    sources += syscall_emulation_sources
702139SN/A
712139SN/A# Convert file names to SCons File objects.  This takes care of the
722139SN/A# path relative to the top of the directory tree.
732139SN/Asources = [File(s) for s in sources]
742139SN/A
752139SN/A# Add in files generated by the ISA description.
762139SN/Aisa_desc_files = env.ISADesc('isa/main.isa')
772139SN/A# Only non-header files need to be compiled.
782139SN/Aisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
792139SN/Asources += isa_desc_sources
802139SN/A
812139SN/AReturn('sources')
822139SN/A