SConscript revision 2686
1360SN/A# -*- mode:python -*- 210850SGiacomo.Gabrielli@arm.com 310796Sbrandon.potter@amd.com# Copyright (c) 2004-2005 The Regents of The University of Michigan 410027SChris.Adeniyi-Jones@arm.com# All rights reserved. 510027SChris.Adeniyi-Jones@arm.com# 610027SChris.Adeniyi-Jones@arm.com# Redistribution and use in source and binary forms, with or without 710027SChris.Adeniyi-Jones@arm.com# modification, are permitted provided that the following conditions are 810027SChris.Adeniyi-Jones@arm.com# met: redistributions of source code must retain the above copyright 910027SChris.Adeniyi-Jones@arm.com# notice, this list of conditions and the following disclaimer; 1010027SChris.Adeniyi-Jones@arm.com# redistributions in binary form must reproduce the above copyright 1110027SChris.Adeniyi-Jones@arm.com# notice, this list of conditions and the following disclaimer in the 1210027SChris.Adeniyi-Jones@arm.com# documentation and/or other materials provided with the distribution; 1310027SChris.Adeniyi-Jones@arm.com# neither the name of the copyright holders nor the names of its 1410027SChris.Adeniyi-Jones@arm.com# contributors may be used to endorse or promote products derived from 151458SN/A# this software without specific prior written permission. 16360SN/A# 17360SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18360SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19360SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20360SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21360SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22360SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23360SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24360SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25360SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26360SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27360SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28360SN/A# 29360SN/A# Authors: Gabe Black 30360SN/A# Steve Reinhardt 31360SN/A# Korey Sewell 32360SN/A 33360SN/Aimport os 34360SN/Aimport sys 35360SN/Afrom os.path import isdir 36360SN/A 37360SN/A# Import build environment variable from SConstruct. 38360SN/AImport('env') 39360SN/A 402665Ssaidi@eecs.umich.edu################################################### 412665Ssaidi@eecs.umich.edu# 422665Ssaidi@eecs.umich.edu# Define needed sources. 43360SN/A# 44360SN/A################################################### 451354SN/A 461354SN/A# Base sources used by all configurations. 47360SN/Abase_sources = Split(''' 482764Sstever@eecs.umich.edu faults.cc 499202Spalle@lyckegaard.dk isa_traits.cc 509202Spalle@lyckegaard.dk utility.cc 512064SN/A ''') 5211799Sbrandon.potter@amd.com 5311799Sbrandon.potter@amd.com# Full-system sources 5411799Sbrandon.potter@amd.comfull_system_sources = Split(''' 5511799Sbrandon.potter@amd.com memory.cc 5611799Sbrandon.potter@amd.com mips34k.cc 5711799Sbrandon.potter@amd.com ''') 58360SN/A 59360SN/A# Syscall emulation (non-full-system) sources 60360SN/Asyscall_emulation_sources = Split(''' 61360SN/A linux/linux.cc 62360SN/A linux/process.cc 63360SN/A process.cc 641809SN/A ''') 6511800Sbrandon.potter@amd.com 6611392Sbrandon.potter@amd.com# Set up complete list of sources based on configuration. 671809SN/Asources = base_sources 6811392Sbrandon.potter@amd.com 6911383Sbrandon.potter@amd.comif env['FULL_SYSTEM']: 703113Sgblack@eecs.umich.edu sources += full_system_sources 7111799Sbrandon.potter@amd.comelse: 7211759Sbrandon.potter@amd.com sources += syscall_emulation_sources 7311812Sbaz21@cam.ac.uk 7411812Sbaz21@cam.ac.uk# Convert file names to SCons File objects. This takes care of the 7511799Sbrandon.potter@amd.com# path relative to the top of the directory tree. 768229Snate@binkert.orgsources = [File(s) for s in sources] 778229Snate@binkert.org 7811594Santhony.gutierrez@amd.com# Add in files generated by the ISA description. 797075Snate@binkert.orgisa_desc_files = env.ISADesc('isa/main.isa') 808229Snate@binkert.org# Only non-header files need to be compiled. 8111856Sbrandon.potter@amd.comisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 827075Snate@binkert.orgsources += isa_desc_sources 83360SN/A 8411886Sbrandon.potter@amd.comReturn('sources') 8511800Sbrandon.potter@amd.com