SConscript revision 2665
1955SN/A# -*- mode:python -*- 2955SN/A 31762SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan 4955SN/A# All rights reserved. 5955SN/A# 6955SN/A# Redistribution and use in source and binary forms, with or without 7955SN/A# modification, are permitted provided that the following conditions are 8955SN/A# met: redistributions of source code must retain the above copyright 9955SN/A# notice, this list of conditions and the following disclaimer; 10955SN/A# redistributions in binary form must reproduce the above copyright 11955SN/A# notice, this list of conditions and the following disclaimer in the 12955SN/A# documentation and/or other materials provided with the distribution; 13955SN/A# neither the name of the copyright holders nor the names of its 14955SN/A# contributors may be used to endorse or promote products derived from 15955SN/A# this software without specific prior written permission. 16955SN/A# 17955SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18955SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19955SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20955SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21955SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22955SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23955SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24955SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25955SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26955SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27955SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 282665Ssaidi@eecs.umich.edu# 294762Snate@binkert.org# Authors: Gabe Black 30955SN/A# Steve Reinhardt 315522Snate@binkert.org 324762Snate@binkert.orgimport os 335522Snate@binkert.orgimport sys 34955SN/Afrom os.path import isdir 355522Snate@binkert.org 36955SN/A# Import build environment variable from SConstruct. 375522Snate@binkert.orgImport('env') 384202Sbinkertn@umich.edu 395342Sstever@gmail.com################################################### 40955SN/A# 414381Sbinkertn@umich.edu# Define needed sources. 424381Sbinkertn@umich.edu# 43955SN/A################################################### 44955SN/A 45955SN/A# Base sources used by all configurations. 464202Sbinkertn@umich.edubase_sources = Split(''' 47955SN/A faults.cc 484382Sbinkertn@umich.edu isa_traits.cc 494382Sbinkertn@umich.edu ''') 504382Sbinkertn@umich.edu 515517Snate@binkert.org# Full-system sources 525517Snate@binkert.orgfull_system_sources = Split(''' 534762Snate@binkert.org vtophys.cc 544762Snate@binkert.org ua2005.cc 554762Snate@binkert.org ''') 564762Snate@binkert.org 574762Snate@binkert.org# Syscall emulation (non-full-system) sources 584762Snate@binkert.orgsyscall_emulation_sources = Split(''' 594762Snate@binkert.org linux/linux.cc 604762Snate@binkert.org linux/process.cc 614762Snate@binkert.org solaris/solaris.cc 624762Snate@binkert.org solaris/process.cc 635522Snate@binkert.org process.cc 644762Snate@binkert.org ''') 654762Snate@binkert.org 664762Snate@binkert.orgsources = base_sources 674762Snate@binkert.org 684762Snate@binkert.orgif env['FULL_SYSTEM']: 695522Snate@binkert.org sources += full_system_sources 705522Snate@binkert.orgelse: 715522Snate@binkert.org sources += syscall_emulation_sources 725522Snate@binkert.org 734762Snate@binkert.org# Convert file names to SCons File objects. This takes care of the 744762Snate@binkert.org# path relative to the top of the directory tree. 754762Snate@binkert.orgsources = [File(s) for s in sources] 764762Snate@binkert.org 774762Snate@binkert.org# Add in files generated by the ISA description. 785522Snate@binkert.orgisa_desc_files = env.ISADesc('isa/main.isa') 794762Snate@binkert.org# Only non-header files need to be compiled. 804762Snate@binkert.orgisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 815522Snate@binkert.orgsources += isa_desc_sources 825522Snate@binkert.org 834762Snate@binkert.orgReturn('sources') 844762Snate@binkert.org