SConscript revision 2458
19651SAndreas.Sandberg@ARM.com# -*- mode:python -*- 29651SAndreas.Sandberg@ARM.com 39651SAndreas.Sandberg@ARM.com# Copyright (c) 2004-2005 The Regents of The University of Michigan 49651SAndreas.Sandberg@ARM.com# All rights reserved. 59651SAndreas.Sandberg@ARM.com# 69651SAndreas.Sandberg@ARM.com# Redistribution and use in source and binary forms, with or without 79651SAndreas.Sandberg@ARM.com# modification, are permitted provided that the following conditions are 89651SAndreas.Sandberg@ARM.com# met: redistributions of source code must retain the above copyright 99651SAndreas.Sandberg@ARM.com# notice, this list of conditions and the following disclaimer; 109651SAndreas.Sandberg@ARM.com# redistributions in binary form must reproduce the above copyright 119651SAndreas.Sandberg@ARM.com# notice, this list of conditions and the following disclaimer in the 129651SAndreas.Sandberg@ARM.com# documentation and/or other materials provided with the distribution; 139651SAndreas.Sandberg@ARM.com# neither the name of the copyright holders nor the names of its 149651SAndreas.Sandberg@ARM.com# contributors may be used to endorse or promote products derived from 159651SAndreas.Sandberg@ARM.com# this software without specific prior written permission. 169651SAndreas.Sandberg@ARM.com# 179651SAndreas.Sandberg@ARM.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 189651SAndreas.Sandberg@ARM.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 199651SAndreas.Sandberg@ARM.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 209651SAndreas.Sandberg@ARM.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 219651SAndreas.Sandberg@ARM.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 229651SAndreas.Sandberg@ARM.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 239651SAndreas.Sandberg@ARM.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 249651SAndreas.Sandberg@ARM.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 259651SAndreas.Sandberg@ARM.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 269651SAndreas.Sandberg@ARM.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 279651SAndreas.Sandberg@ARM.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 289651SAndreas.Sandberg@ARM.com 299651SAndreas.Sandberg@ARM.comimport os 309651SAndreas.Sandberg@ARM.comimport sys 319651SAndreas.Sandberg@ARM.comfrom os.path import isdir 329651SAndreas.Sandberg@ARM.com 339651SAndreas.Sandberg@ARM.com# Import build environment variable from SConstruct. 349651SAndreas.Sandberg@ARM.comImport('env') 359651SAndreas.Sandberg@ARM.com 369651SAndreas.Sandberg@ARM.com################################################### 379651SAndreas.Sandberg@ARM.com# 389651SAndreas.Sandberg@ARM.com# Define needed sources. 399651SAndreas.Sandberg@ARM.com# 409651SAndreas.Sandberg@ARM.com################################################### 419651SAndreas.Sandberg@ARM.com 429651SAndreas.Sandberg@ARM.com# Base sources used by all configurations. 439651SAndreas.Sandberg@ARM.combase_sources = Split(''' 449651SAndreas.Sandberg@ARM.com faults.cc 459651SAndreas.Sandberg@ARM.com isa_traits.cc 469651SAndreas.Sandberg@ARM.com ''') 479651SAndreas.Sandberg@ARM.com 489651SAndreas.Sandberg@ARM.com# Full-system sources 499651SAndreas.Sandberg@ARM.comfull_system_sources = Split(''' 509651SAndreas.Sandberg@ARM.com tlb.cc 519657Sandreas.sandberg@arm.com arguments.cc 529657Sandreas.sandberg@arm.com ev5.cc 539657Sandreas.sandberg@arm.com osfpal.cc 549883Sandreas@sandberg.pp.se stacktrace.cc 559883Sandreas@sandberg.pp.se vtophys.cc 569883Sandreas@sandberg.pp.se ''') 579657Sandreas.sandberg@arm.com 589651SAndreas.Sandberg@ARM.com# Syscall emulation (non-full-system) sources 599651SAndreas.Sandberg@ARM.comsyscall_emulation_sources = Split(''' 609651SAndreas.Sandberg@ARM.com linux/process.cc 619651SAndreas.Sandberg@ARM.com process.cc 629651SAndreas.Sandberg@ARM.com ''') 639651SAndreas.Sandberg@ARM.com 649651SAndreas.Sandberg@ARM.comsources = base_sources 659651SAndreas.Sandberg@ARM.com 669651SAndreas.Sandberg@ARM.comif env['FULL_SYSTEM']: 679651SAndreas.Sandberg@ARM.com sources += full_system_sources 68else: 69 sources += syscall_emulation_sources 70 71# Convert file names to SCons File objects. This takes care of the 72# path relative to the top of the directory tree. 73sources = [File(s) for s in sources] 74 75# Add in files generated by the ISA description. 76isa_desc_files = env.ISADesc('isa/main.isa') 77# Only non-header files need to be compiled. 78isa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 79sources += isa_desc_sources 80 81Return('sources') 82