SConscript revision 2221
1955SN/A# -*- mode:python -*- 2955SN/A 35871Snate@binkert.org# Copyright (c) 2004-2005 The Regents of The University of Michigan 41762SN/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. 28955SN/A 292665Ssaidi@eecs.umich.eduimport os 302665Ssaidi@eecs.umich.eduimport sys 315863Snate@binkert.orgfrom os.path import isdir 32955SN/A 33955SN/A# This file defines how to build a particular configuration of M5 34955SN/A# based on variable settings in the 'env' build environment. 35955SN/A 36955SN/A# Import build environment variable from SConstruct. 372632Sstever@eecs.umich.eduImport('env') 382632Sstever@eecs.umich.edu 392632Sstever@eecs.umich.edu################################################### 402632Sstever@eecs.umich.edu# 41955SN/A# Define needed sources. 422632Sstever@eecs.umich.edu# 432632Sstever@eecs.umich.edu################################################### 442761Sstever@eecs.umich.edu 452632Sstever@eecs.umich.edu# Base sources used by all configurations. 462632Sstever@eecs.umich.edubase_sources = Split(''' 472632Sstever@eecs.umich.edu faults.cc 482761Sstever@eecs.umich.edu isa_traits.cc 492761Sstever@eecs.umich.edu ''') 502761Sstever@eecs.umich.edu 512632Sstever@eecs.umich.edu# Full-system sources 522632Sstever@eecs.umich.edufull_system_sources = Split(''' 532761Sstever@eecs.umich.edu tlb.cc 542761Sstever@eecs.umich.edu arguments.cc 552761Sstever@eecs.umich.edu ev5.cc 562761Sstever@eecs.umich.edu osfpal.cc 572761Sstever@eecs.umich.edu stacktrace.cc 582632Sstever@eecs.umich.edu vtophys.cc 592632Sstever@eecs.umich.edu system.cc 602632Sstever@eecs.umich.edu freebsd/system.cc 612632Sstever@eecs.umich.edu linux/system.cc 622632Sstever@eecs.umich.edu tru64/system.cc 632632Sstever@eecs.umich.edu ''') 642632Sstever@eecs.umich.edu 65955SN/A 66955SN/A# Syscall emulation (non-full-system) sources 67955SN/Asyscall_emulation_sources = Split(''' 685863Snate@binkert.org common_syscall_emul.cc 695863Snate@binkert.org linux/process.cc 705863Snate@binkert.org tru64/process.cc 715863Snate@binkert.org process.cc 725863Snate@binkert.org ''') 735863Snate@binkert.org 745863Snate@binkert.org# Set up complete list of sources based on configuration. 755863Snate@binkert.orgsources = base_sources 765863Snate@binkert.org 775863Snate@binkert.orgif env['FULL_SYSTEM']: 785863Snate@binkert.org sources += full_system_sources 795863Snate@binkert.orgelse: 805863Snate@binkert.org sources += syscall_emulation_sources 815863Snate@binkert.org 825863Snate@binkert.org# Convert file names to SCons File objects. This takes care of the 835863Snate@binkert.org# path relative to the top of the directory tree. 845863Snate@binkert.orgsources = [File(s) for s in sources] 855863Snate@binkert.org 865863Snate@binkert.org# Add in files generated by the ISA description. 875863Snate@binkert.orgisa_desc_files = env.ISADesc('isa/main.isa') 885863Snate@binkert.org# Only non-header files need to be compiled. 895863Snate@binkert.orgisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 905863Snate@binkert.orgsources += isa_desc_sources 915863Snate@binkert.org 925863Snate@binkert.orgReturn('sources') 935863Snate@binkert.org