SConscript revision 2597
15331Sgblack@eecs.umich.edu# -*- mode:python -*- 25331Sgblack@eecs.umich.edu 35331Sgblack@eecs.umich.edu# Copyright (c) 2004-2005 The Regents of The University of Michigan 45331Sgblack@eecs.umich.edu# All rights reserved. 55331Sgblack@eecs.umich.edu# 65331Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without 75331Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are 85331Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright 95331Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer; 105331Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright 115331Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the 125331Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution; 135331Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its 145331Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from 155331Sgblack@eecs.umich.edu# this software without specific prior written permission. 165331Sgblack@eecs.umich.edu# 175331Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 185331Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 195331Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 205331Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 215331Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 225331Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 235331Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 245331Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 255331Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 265331Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 275331Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 285331Sgblack@eecs.umich.edu 295331Sgblack@eecs.umich.eduimport os 304276Sgblack@eecs.umich.eduimport sys 314276Sgblack@eecs.umich.edufrom os.path import isdir 324276Sgblack@eecs.umich.edu 334276Sgblack@eecs.umich.edu# Import build environment variable from SConstruct. 344276Sgblack@eecs.umich.eduImport('env') 354276Sgblack@eecs.umich.edu 364276Sgblack@eecs.umich.edu################################################### 374276Sgblack@eecs.umich.edu# 384276Sgblack@eecs.umich.edu# Define needed sources. 394276Sgblack@eecs.umich.edu# 404276Sgblack@eecs.umich.edu################################################### 414276Sgblack@eecs.umich.edu 424276Sgblack@eecs.umich.edu# Base sources used by all configurations. 434276Sgblack@eecs.umich.edubase_sources = Split(''' 444276Sgblack@eecs.umich.edu faults.cc 454276Sgblack@eecs.umich.edu isa_traits.cc 464276Sgblack@eecs.umich.edu ''') 474276Sgblack@eecs.umich.edu 484276Sgblack@eecs.umich.edu# Full-system sources 494276Sgblack@eecs.umich.edufull_system_sources = Split(''' 504276Sgblack@eecs.umich.edu tlb.cc 514276Sgblack@eecs.umich.edu arguments.cc 524276Sgblack@eecs.umich.edu ev5.cc 534276Sgblack@eecs.umich.edu osfpal.cc 544276Sgblack@eecs.umich.edu stacktrace.cc 554276Sgblack@eecs.umich.edu vtophys.cc 564276Sgblack@eecs.umich.edu ''') 574276Sgblack@eecs.umich.edu 584276Sgblack@eecs.umich.edu# Syscall emulation (non-full-system) sources 594276Sgblack@eecs.umich.edusyscall_emulation_sources = Split(''' 604276Sgblack@eecs.umich.edu linux/linux.cc 614276Sgblack@eecs.umich.edu linux/process.cc 624276Sgblack@eecs.umich.edu process.cc 634276Sgblack@eecs.umich.edu ''') 644276Sgblack@eecs.umich.edu 654276Sgblack@eecs.umich.edusources = base_sources 664276Sgblack@eecs.umich.edu 674276Sgblack@eecs.umich.eduif env['FULL_SYSTEM']: 684276Sgblack@eecs.umich.edu sources += full_system_sources 694276Sgblack@eecs.umich.eduelse: 704276Sgblack@eecs.umich.edu sources += syscall_emulation_sources 714276Sgblack@eecs.umich.edu 724276Sgblack@eecs.umich.edu# Convert file names to SCons File objects. This takes care of the 734276Sgblack@eecs.umich.edu# path relative to the top of the directory tree. 744276Sgblack@eecs.umich.edusources = [File(s) for s in sources] 754276Sgblack@eecs.umich.edu 764276Sgblack@eecs.umich.edu# Add in files generated by the ISA description. 774276Sgblack@eecs.umich.eduisa_desc_files = env.ISADesc('isa/main.isa') 784276Sgblack@eecs.umich.edu# Only non-header files need to be compiled. 794276Sgblack@eecs.umich.eduisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 804276Sgblack@eecs.umich.edusources += isa_desc_sources 814276Sgblack@eecs.umich.edu 824276Sgblack@eecs.umich.eduReturn('sources') 834276Sgblack@eecs.umich.edu