SConscript revision 2221
17404SAli.Saidi@ARM.com# -*- mode:python -*- 29015Sandreas.hansson@arm.com 37404SAli.Saidi@ARM.com# Copyright (c) 2004-2005 The Regents of The University of Michigan 47404SAli.Saidi@ARM.com# All rights reserved. 57404SAli.Saidi@ARM.com# 67404SAli.Saidi@ARM.com# Redistribution and use in source and binary forms, with or without 77404SAli.Saidi@ARM.com# modification, are permitted provided that the following conditions are 87404SAli.Saidi@ARM.com# met: redistributions of source code must retain the above copyright 97404SAli.Saidi@ARM.com# notice, this list of conditions and the following disclaimer; 107404SAli.Saidi@ARM.com# redistributions in binary form must reproduce the above copyright 117404SAli.Saidi@ARM.com# notice, this list of conditions and the following disclaimer in the 127404SAli.Saidi@ARM.com# documentation and/or other materials provided with the distribution; 137404SAli.Saidi@ARM.com# neither the name of the copyright holders nor the names of its 147404SAli.Saidi@ARM.com# contributors may be used to endorse or promote products derived from 157404SAli.Saidi@ARM.com# this software without specific prior written permission. 167404SAli.Saidi@ARM.com# 177404SAli.Saidi@ARM.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 187404SAli.Saidi@ARM.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 197404SAli.Saidi@ARM.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 207404SAli.Saidi@ARM.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 217404SAli.Saidi@ARM.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 227404SAli.Saidi@ARM.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 237404SAli.Saidi@ARM.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 247404SAli.Saidi@ARM.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 257404SAli.Saidi@ARM.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 267404SAli.Saidi@ARM.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 277404SAli.Saidi@ARM.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 287404SAli.Saidi@ARM.com 297404SAli.Saidi@ARM.comimport os 307404SAli.Saidi@ARM.comimport sys 317404SAli.Saidi@ARM.comfrom os.path import isdir 327404SAli.Saidi@ARM.com 337404SAli.Saidi@ARM.com# This file defines how to build a particular configuration of M5 347404SAli.Saidi@ARM.com# based on variable settings in the 'env' build environment. 357404SAli.Saidi@ARM.com 367404SAli.Saidi@ARM.com# Import build environment variable from SConstruct. 377404SAli.Saidi@ARM.comImport('env') 387404SAli.Saidi@ARM.com 397404SAli.Saidi@ARM.com################################################### 407404SAli.Saidi@ARM.com# 417404SAli.Saidi@ARM.com# Define needed sources. 427404SAli.Saidi@ARM.com# 437578Sdam.sunwoo@arm.com################################################### 447578Sdam.sunwoo@arm.com 457404SAli.Saidi@ARM.com# Base sources used by all configurations. 467404SAli.Saidi@ARM.combase_sources = Split(''' 479016Sandreas.hansson@arm.com faults.cc 487404SAli.Saidi@ARM.com isa_traits.cc 497404SAli.Saidi@ARM.com ''') 507404SAli.Saidi@ARM.com 517404SAli.Saidi@ARM.com# Full-system sources 527878Sgblack@eecs.umich.edufull_system_sources = Split(''' 537404SAli.Saidi@ARM.com tlb.cc 547404SAli.Saidi@ARM.com arguments.cc 557404SAli.Saidi@ARM.com ev5.cc 567404SAli.Saidi@ARM.com osfpal.cc 577404SAli.Saidi@ARM.com stacktrace.cc 587404SAli.Saidi@ARM.com vtophys.cc 597404SAli.Saidi@ARM.com system.cc 607404SAli.Saidi@ARM.com freebsd/system.cc 617404SAli.Saidi@ARM.com linux/system.cc 627694SAli.Saidi@ARM.com tru64/system.cc 637404SAli.Saidi@ARM.com ''') 647404SAli.Saidi@ARM.com 657404SAli.Saidi@ARM.com 667404SAli.Saidi@ARM.com# Syscall emulation (non-full-system) sources 677404SAli.Saidi@ARM.comsyscall_emulation_sources = Split(''' 687404SAli.Saidi@ARM.com common_syscall_emul.cc 697404SAli.Saidi@ARM.com linux/process.cc 707404SAli.Saidi@ARM.com tru64/process.cc 717404SAli.Saidi@ARM.com process.cc 727436Sdam.sunwoo@arm.com ''') 737404SAli.Saidi@ARM.com 747404SAli.Saidi@ARM.com# Set up complete list of sources based on configuration. 757436Sdam.sunwoo@arm.comsources = base_sources 767436Sdam.sunwoo@arm.com 777436Sdam.sunwoo@arm.comif env['FULL_SYSTEM']: 787436Sdam.sunwoo@arm.com sources += full_system_sources 797404SAli.Saidi@ARM.comelse: 807404SAli.Saidi@ARM.com sources += syscall_emulation_sources 817404SAli.Saidi@ARM.com 827404SAli.Saidi@ARM.com# Convert file names to SCons File objects. This takes care of the 837404SAli.Saidi@ARM.com# path relative to the top of the directory tree. 847404SAli.Saidi@ARM.comsources = [File(s) for s in sources] 857404SAli.Saidi@ARM.com 867404SAli.Saidi@ARM.com# Add in files generated by the ISA description. 877404SAli.Saidi@ARM.comisa_desc_files = env.ISADesc('isa/main.isa') 887404SAli.Saidi@ARM.com# Only non-header files need to be compiled. 897404SAli.Saidi@ARM.comisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 907404SAli.Saidi@ARM.comsources += isa_desc_sources 917404SAli.Saidi@ARM.com 927404SAli.Saidi@ARM.comReturn('sources') 937404SAli.Saidi@ARM.com