SConscript revision 2623
110448Snilay@cs.wisc.edu# -*- mode:python -*- 210448Snilay@cs.wisc.edu 310448Snilay@cs.wisc.edu# Copyright (c) 2004-2005 The Regents of The University of Michigan 410448Snilay@cs.wisc.edu# All rights reserved. 510448Snilay@cs.wisc.edu# 610448Snilay@cs.wisc.edu# Redistribution and use in source and binary forms, with or without 710448Snilay@cs.wisc.edu# modification, are permitted provided that the following conditions are 810448Snilay@cs.wisc.edu# met: redistributions of source code must retain the above copyright 910448Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer; 1010448Snilay@cs.wisc.edu# redistributions in binary form must reproduce the above copyright 1110448Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer in the 1210448Snilay@cs.wisc.edu# documentation and/or other materials provided with the distribution; 1310448Snilay@cs.wisc.edu# neither the name of the copyright holders nor the names of its 1410448Snilay@cs.wisc.edu# contributors may be used to endorse or promote products derived from 1510448Snilay@cs.wisc.edu# this software without specific prior written permission. 1610448Snilay@cs.wisc.edu# 1710448Snilay@cs.wisc.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1810448Snilay@cs.wisc.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1910448Snilay@cs.wisc.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2010448Snilay@cs.wisc.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2110448Snilay@cs.wisc.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2210447Snilay@cs.wisc.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2310447Snilay@cs.wisc.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2410447Snilay@cs.wisc.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2510447Snilay@cs.wisc.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2610447Snilay@cs.wisc.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2710447Snilay@cs.wisc.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2810447Snilay@cs.wisc.edu 2910447Snilay@cs.wisc.eduimport os 3010447Snilay@cs.wisc.eduimport sys 3110447Snilay@cs.wisc.edufrom os.path import isdir 3210447Snilay@cs.wisc.edu 3310447Snilay@cs.wisc.edu# Import build environment variable from SConstruct. 3410447Snilay@cs.wisc.eduImport('env') 3510447Snilay@cs.wisc.edu 3610447Snilay@cs.wisc.edu################################################### 3710447Snilay@cs.wisc.edu# 3810447Snilay@cs.wisc.edu# Define needed sources. 3910447Snilay@cs.wisc.edu# 4010447Snilay@cs.wisc.edu################################################### 4110447Snilay@cs.wisc.edu 4210447Snilay@cs.wisc.edu# Base sources used by all configurations. 4310447Snilay@cs.wisc.edubase_sources = Split(''' 4410447Snilay@cs.wisc.edu faults.cc 4510447Snilay@cs.wisc.edu isa_traits.cc 4610447Snilay@cs.wisc.edu ''') 4710447Snilay@cs.wisc.edu 4810447Snilay@cs.wisc.edu# Full-system sources 4910447Snilay@cs.wisc.edufull_system_sources = Split(''' 5010447Snilay@cs.wisc.edu memory.cc 5110447Snilay@cs.wisc.edu arguments.cc 5210447Snilay@cs.wisc.edu mips34k.cc 5310447Snilay@cs.wisc.edu osfpal.cc 5410447Snilay@cs.wisc.edu stacktrace.cc 5510447Snilay@cs.wisc.edu vtophys.cc 5610447Snilay@cs.wisc.edu ''') 5710447Snilay@cs.wisc.edu 5810447Snilay@cs.wisc.edu# Syscall emulation (non-full-system) sources 5910447Snilay@cs.wisc.edusyscall_emulation_sources = Split(''' 60 linux/linux.cc 61 linux/process.cc 62 process.cc 63 ''') 64 65# Set up complete list of sources based on configuration. 66sources = base_sources 67 68if env['FULL_SYSTEM']: 69 sources += full_system_sources 70else: 71 sources += syscall_emulation_sources 72 73# Convert file names to SCons File objects. This takes care of the 74# path relative to the top of the directory tree. 75sources = [File(s) for s in sources] 76 77# Add in files generated by the ISA description. 78isa_desc_files = env.ISADesc('isa/main.isa') 79# Only non-header files need to be compiled. 80isa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 81sources += isa_desc_sources 82 83Return('sources') 84