SConscript revision 2209
111103Snilay@cs.wisc.edu# -*- mode:python -*- 211103Snilay@cs.wisc.edu 38441SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan 48441SN/A# All rights reserved. 57893SN/A# 611103Snilay@cs.wisc.edu# Redistribution and use in source and binary forms, with or without 711103Snilay@cs.wisc.edu# modification, are permitted provided that the following conditions are 811103Snilay@cs.wisc.edu# met: redistributions of source code must retain the above copyright 911103Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer; 1010798Ssteve.reinhardt@amd.com# redistributions in binary form must reproduce the above copyright 1110036SAli.Saidi@ARM.com# notice, this list of conditions and the following disclaimer in the 1210036SAli.Saidi@ARM.com# documentation and/or other materials provided with the distribution; 137893SN/A# neither the name of the copyright holders nor the names of its 147893SN/A# contributors may be used to endorse or promote products derived from 157893SN/A# this software without specific prior written permission. 167893SN/A# 177893SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 187893SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 197893SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 207893SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 217893SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 227893SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 237893SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2411103Snilay@cs.wisc.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 257893SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 267893SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 277893SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 287893SN/A 297893SN/Aimport os 3011103Snilay@cs.wisc.eduimport sys 3111103Snilay@cs.wisc.edufrom os.path import isdir 32 33# Import build environment variable from SConstruct. 34Import('env') 35 36################################################### 37# 38# Define needed sources. 39# 40################################################### 41 42# Base sources used by all configurations. 43base_sources = Split(''' 44 faults.cc 45 isa_traits.cc 46 ''') 47 48# Full-system sources 49full_system_sources = Split(''' 50 tlb.cc 51 arguments.cc 52 ev5.cc 53 osfpal.cc 54 stacktrace.cc 55 vtophys.cc 56 ''') 57 58# Syscall emulation (non-full-system) sources 59syscall_emulation_sources = Split(''' 60 common_syscall_emul.cc 61 linux_process.cc 62 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