SConscript revision 2632:1bb2f91485ea
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
292665Ssaidi@eecs.umich.eduimport os
30955SN/Aimport sys
31955SN/Afrom os.path import isdir
32955SN/A
33955SN/A# Import build environment variable from SConstruct.
34955SN/AImport('env')
352632Sstever@eecs.umich.edu
362632Sstever@eecs.umich.edu###################################################
372632Sstever@eecs.umich.edu#
382632Sstever@eecs.umich.edu# Define needed sources.
39955SN/A#
402632Sstever@eecs.umich.edu###################################################
412632Sstever@eecs.umich.edu
422761Sstever@eecs.umich.edu# Base sources used by all configurations.
432632Sstever@eecs.umich.edubase_sources = Split('''
442632Sstever@eecs.umich.edu	faults.cc
452632Sstever@eecs.umich.edu	isa_traits.cc
462761Sstever@eecs.umich.edu	''')
472761Sstever@eecs.umich.edu
482761Sstever@eecs.umich.edu# Full-system sources
492632Sstever@eecs.umich.edufull_system_sources = Split('''
502632Sstever@eecs.umich.edu	memory.cc
512761Sstever@eecs.umich.edu	arguments.cc
522761Sstever@eecs.umich.edu	mips34k.cc
532761Sstever@eecs.umich.edu	osfpal.cc
542761Sstever@eecs.umich.edu	stacktrace.cc
552761Sstever@eecs.umich.edu	vtophys.cc
562632Sstever@eecs.umich.edu	''')
572632Sstever@eecs.umich.edu
582632Sstever@eecs.umich.edu# Syscall emulation (non-full-system) sources
592632Sstever@eecs.umich.edusyscall_emulation_sources = Split('''
602632Sstever@eecs.umich.edu        linux/linux.cc
612632Sstever@eecs.umich.edu	linux/process.cc
622632Sstever@eecs.umich.edu        process.cc
63955SN/A	''')
64955SN/A
65955SN/A# Set up complete list of sources based on configuration.
66955SN/Asources = base_sources
67955SN/A
68955SN/Aif env['FULL_SYSTEM']:
69955SN/A    sources += full_system_sources
702656Sstever@eecs.umich.eduelse:
712656Sstever@eecs.umich.edu    sources += syscall_emulation_sources
722656Sstever@eecs.umich.edu
732656Sstever@eecs.umich.edu# Convert file names to SCons File objects.  This takes care of the
742656Sstever@eecs.umich.edu# path relative to the top of the directory tree.
752656Sstever@eecs.umich.edusources = [File(s) for s in sources]
762656Sstever@eecs.umich.edu
772653Sstever@eecs.umich.edu# Add in files generated by the ISA description.
782653Sstever@eecs.umich.eduisa_desc_files = env.ISADesc('isa/main.isa')
792653Sstever@eecs.umich.edu# Only non-header files need to be compiled.
802653Sstever@eecs.umich.eduisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
812653Sstever@eecs.umich.edusources += isa_desc_sources
822653Sstever@eecs.umich.edu
832653Sstever@eecs.umich.eduReturn('sources')
842653Sstever@eecs.umich.edu