SConscript revision 2178
15156SN/A# -*- mode:python -*- 25156SN/A 37873SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan 49583Snilay@cs.wisc.edu# All rights reserved. 59583Snilay@cs.wisc.edu# 68673SN/A# Redistribution and use in source and binary forms, with or without 79702Snilay@cs.wisc.edu# modification, are permitted provided that the following conditions are 89702Snilay@cs.wisc.edu# met: redistributions of source code must retain the above copyright 99702Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer; 109702Snilay@cs.wisc.edu# redistributions in binary form must reproduce the above copyright 119702Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer in the 129150SAli.Saidi@ARM.com# documentation and/or other materials provided with the distribution; 139583Snilay@cs.wisc.edu# neither the name of the copyright holders nor the names of its 149150SAli.Saidi@ARM.com# contributors may be used to endorse or promote products derived from 159583Snilay@cs.wisc.edu# this software without specific prior written permission. 169583Snilay@cs.wisc.edu# 179150SAli.Saidi@ARM.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 189150SAli.Saidi@ARM.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 199373Snilay@cs.wisc.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 209373Snilay@cs.wisc.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 219150SAli.Saidi@ARM.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 229583Snilay@cs.wisc.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 239583Snilay@cs.wisc.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 249373Snilay@cs.wisc.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 259373Snilay@cs.wisc.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 269583Snilay@cs.wisc.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 279150SAli.Saidi@ARM.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 289583Snilay@cs.wisc.edu 299583Snilay@cs.wisc.eduimport os 309583Snilay@cs.wisc.eduimport sys 319373Snilay@cs.wisc.edufrom os.path import isdir 329373Snilay@cs.wisc.edu 339583Snilay@cs.wisc.edu# Import build environment variable from SConstruct. 349373Snilay@cs.wisc.eduImport('env') 359583Snilay@cs.wisc.edu 368673SN/A################################################### 379583Snilay@cs.wisc.edu# 388673SN/A# Define needed sources. 397935SN/A# 409150SAli.Saidi@ARM.com################################################### 419583Snilay@cs.wisc.edu 429583Snilay@cs.wisc.edu# Base sources used by all configurations. 438673SN/Abase_sources = Split(''' 449702Snilay@cs.wisc.edu faults.cc 459150SAli.Saidi@ARM.com isa_traits.cc 469583Snilay@cs.wisc.edu ''') 477935SN/A 489583Snilay@cs.wisc.edu# Full-system sources 499583Snilay@cs.wisc.edufull_system_sources = Split(''' 507935SN/A alpha_memory.cc 517935SN/A arguments.cc 529583Snilay@cs.wisc.edu ev5.cc 539583Snilay@cs.wisc.edu osfpal.cc 549373Snilay@cs.wisc.edu stacktrace.cc 557935SN/A vtophys.cc 569583Snilay@cs.wisc.edu ''') 578673SN/A 588673SN/A# Syscall emulation (non-full-system) sources 595156SN/Asyscall_emulation_sources = Split(''' 605156SN/A alpha_common_syscall_emul.cc 61 alpha_linux_process.cc 62 alpha_tru64_process.cc 63 ''') 64 65sources = base_sources 66 67if env['FULL_SYSTEM']: 68 sources += full_system_sources 69else: 70 sources += syscall_emulation_sources 71 72# Convert file names to SCons File objects. This takes care of the 73# path relative to the top of the directory tree. 74sources = [File(s) for s in sources] 75 76# Add in files generated by the ISA description. 77isa_desc_files = env.ISADesc('isa/main.isa') 78# Only non-header files need to be compiled. 79isa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 80sources += isa_desc_sources 81 82Return('sources') 83