SConscript revision 3551:08d588714ee1
110447Snilay@cs.wisc.edu# -*- mode:python -*- 210447Snilay@cs.wisc.edu 310447Snilay@cs.wisc.edu# Copyright (c) 2004-2005 The Regents of The University of Michigan 410447Snilay@cs.wisc.edu# All rights reserved. 510447Snilay@cs.wisc.edu# 610447Snilay@cs.wisc.edu# Redistribution and use in source and binary forms, with or without 710447Snilay@cs.wisc.edu# modification, are permitted provided that the following conditions are 810447Snilay@cs.wisc.edu# met: redistributions of source code must retain the above copyright 910447Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer; 1010447Snilay@cs.wisc.edu# redistributions in binary form must reproduce the above copyright 1110447Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer in the 1210447Snilay@cs.wisc.edu# documentation and/or other materials provided with the distribution; 1310447Snilay@cs.wisc.edu# neither the name of the copyright holders nor the names of its 1410447Snilay@cs.wisc.edu# contributors may be used to endorse or promote products derived from 1510447Snilay@cs.wisc.edu# this software without specific prior written permission. 1610447Snilay@cs.wisc.edu# 1710447Snilay@cs.wisc.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1810447Snilay@cs.wisc.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1910447Snilay@cs.wisc.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2010447Snilay@cs.wisc.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2110447Snilay@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.edu# Authors: Gabe Black 3010447Snilay@cs.wisc.edu# Steve Reinhardt 3110447Snilay@cs.wisc.edu 3210447Snilay@cs.wisc.eduimport os 3310447Snilay@cs.wisc.eduimport sys 3410447Snilay@cs.wisc.edufrom os.path import isdir 3510447Snilay@cs.wisc.edu 3610447Snilay@cs.wisc.edu# Import build environment variable from SConstruct. 3710447Snilay@cs.wisc.eduImport('env') 3810447Snilay@cs.wisc.edu 3910447Snilay@cs.wisc.edu################################################### 4010447Snilay@cs.wisc.edu# 4110447Snilay@cs.wisc.edu# Define needed sources. 4210447Snilay@cs.wisc.edu# 4310447Snilay@cs.wisc.edu################################################### 4410447Snilay@cs.wisc.edu 4510447Snilay@cs.wisc.edu# Base sources used by all configurations. 4610447Snilay@cs.wisc.edubase_sources = Split(''' 4710447Snilay@cs.wisc.edu asi.cc 4810447Snilay@cs.wisc.edu faults.cc 4910447Snilay@cs.wisc.edu floatregfile.cc 5010447Snilay@cs.wisc.edu intregfile.cc 5110447Snilay@cs.wisc.edu miscregfile.cc 5210447Snilay@cs.wisc.edu regfile.cc 5310447Snilay@cs.wisc.edu ''') 5410447Snilay@cs.wisc.edu 5510447Snilay@cs.wisc.edu# Full-system sources 5610447Snilay@cs.wisc.edufull_system_sources = Split(''' 5710447Snilay@cs.wisc.edu arguments.cc 5810447Snilay@cs.wisc.edu remote_gdb.cc 5910447Snilay@cs.wisc.edu stacktrace.cc 6010447Snilay@cs.wisc.edu system.cc 6110447Snilay@cs.wisc.edu tlb.cc 6210447Snilay@cs.wisc.edu vtophys.cc 6310447Snilay@cs.wisc.edu ''') 6410447Snilay@cs.wisc.edu 6510447Snilay@cs.wisc.edu# Syscall emulation (non-full-system) sources 6610447Snilay@cs.wisc.edusyscall_emulation_sources = Split(''' 6710447Snilay@cs.wisc.edu linux/linux.cc 6810447Snilay@cs.wisc.edu linux/process.cc 6910447Snilay@cs.wisc.edu process.cc 7010447Snilay@cs.wisc.edu solaris/process.cc 7110447Snilay@cs.wisc.edu solaris/solaris.cc 7210447Snilay@cs.wisc.edu ''') 7310447Snilay@cs.wisc.edu 7410447Snilay@cs.wisc.edusources = base_sources 7510447Snilay@cs.wisc.edu 7610447Snilay@cs.wisc.eduif env['FULL_SYSTEM']: 7710447Snilay@cs.wisc.edu sources += full_system_sources 7810447Snilay@cs.wisc.eduelse: 7910447Snilay@cs.wisc.edu sources += syscall_emulation_sources 8010447Snilay@cs.wisc.edu 8110447Snilay@cs.wisc.edu# Convert file names to SCons File objects. This takes care of the 8210447Snilay@cs.wisc.edu# path relative to the top of the directory tree. 8310447Snilay@cs.wisc.edusources = [File(s) for s in sources] 8410447Snilay@cs.wisc.edu 8510447Snilay@cs.wisc.edu# Add in files generated by the ISA description. 8610447Snilay@cs.wisc.eduisa_desc_files = env.ISADesc('isa/main.isa') 8710447Snilay@cs.wisc.edu# Only non-header files need to be compiled. 8810447Snilay@cs.wisc.eduisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 8910447Snilay@cs.wisc.edusources += isa_desc_sources 9010447Snilay@cs.wisc.edu 9110447Snilay@cs.wisc.eduReturn('sources') 9210447Snilay@cs.wisc.edu