SConscript revision 2292
17513SN/A# -*- mode:python -*- 27513SN/A 37513SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan 47935SN/A# All rights reserved. 57935SN/A# 67935SN/A# Redistribution and use in source and binary forms, with or without 77513SN/A# modification, are permitted provided that the following conditions are 87513SN/A# met: redistributions of source code must retain the above copyright 97513SN/A# notice, this list of conditions and the following disclaimer; 107513SN/A# redistributions in binary form must reproduce the above copyright 117513SN/A# notice, this list of conditions and the following disclaimer in the 128721SN/A# documentation and/or other materials provided with the distribution; 138721SN/A# neither the name of the copyright holders nor the names of its 147513SN/A# contributors may be used to endorse or promote products derived from 157935SN/A# this software without specific prior written permission. 167935SN/A# 177935SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 187935SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 197935SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 207935SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 217935SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 228721SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 237513SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 247513SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 257513SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 267513SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 277513SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 287513SN/A 297513SN/Aimport os 307513SN/Aimport sys 317513SN/Afrom os.path import isdir 327513SN/A 337513SN/A# Import build environment variable from SConstruct. 347513SN/AImport('env') 357513SN/A 367513SN/A################################################### 377513SN/A# 387513SN/A# Define needed sources. 397513SN/A# 407513SN/A################################################### 417513SN/A 427513SN/A# Base sources used by all configurations. 437513SN/Abase_sources = Split(''' 447513SN/A faults.cc 457513SN/A isa_traits.cc 467513SN/A ''') 477513SN/A 487513SN/A# Full-system sources 497513SN/Afull_system_sources = Split(''' 507513SN/A tlb.cc 517513SN/A arguments.cc 527513SN/A ev5.cc 537513SN/A osfpal.cc 547513SN/A stacktrace.cc 557513SN/A vtophys.cc 567513SN/A ''') 578150SN/A 587513SN/A# Syscall emulation (non-full-system) sources 597513SN/Asyscall_emulation_sources = Split(''' 607513SN/A common_syscall_emul.cc 617513SN/A linux_process.cc 627513SN/A process.cc 637513SN/A ''') 647513SN/A 657513SN/Asources = base_sources 667513SN/A 677513SN/Aif env['FULL_SYSTEM']: 687513SN/A sources += full_system_sources 697513SN/Aelse: 707513SN/A sources += syscall_emulation_sources 717513SN/A 727513SN/A# Convert file names to SCons File objects. This takes care of the 737513SN/A# path relative to the top of the directory tree. 747513SN/Asources = [File(s) for s in sources] 757513SN/A 767513SN/A# Add in files generated by the ISA description. 777513SN/Aisa_desc_files = env.ISADesc('isa/main.isa') 787513SN/A# Only non-header files need to be compiled. 797513SN/Aisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 807513SN/Asources += isa_desc_sources 817513SN/A 827513SN/AReturn('sources') 837513SN/A