SConscript revision 2152
15353Svilas.sridharan@gmail.com# -*- mode:python -*- 23395Shsul@eecs.umich.edu 33395Shsul@eecs.umich.edu# Copyright (c) 2004-2005 The Regents of The University of Michigan 43395Shsul@eecs.umich.edu# All rights reserved. 53395Shsul@eecs.umich.edu# 63395Shsul@eecs.umich.edu# Redistribution and use in source and binary forms, with or without 73395Shsul@eecs.umich.edu# modification, are permitted provided that the following conditions are 83395Shsul@eecs.umich.edu# met: redistributions of source code must retain the above copyright 93395Shsul@eecs.umich.edu# notice, this list of conditions and the following disclaimer; 103395Shsul@eecs.umich.edu# redistributions in binary form must reproduce the above copyright 113395Shsul@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the 123395Shsul@eecs.umich.edu# documentation and/or other materials provided with the distribution; 133395Shsul@eecs.umich.edu# neither the name of the copyright holders nor the names of its 143395Shsul@eecs.umich.edu# contributors may be used to endorse or promote products derived from 153395Shsul@eecs.umich.edu# this software without specific prior written permission. 163395Shsul@eecs.umich.edu# 173395Shsul@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 183395Shsul@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 193395Shsul@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 203395Shsul@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 213395Shsul@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 223395Shsul@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 233395Shsul@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 243395Shsul@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 253395Shsul@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 263395Shsul@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 273395Shsul@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 283395Shsul@eecs.umich.edu 298920Snilay@cs.wisc.eduimport os 308920Snilay@cs.wisc.eduimport sys 318920Snilay@cs.wisc.edufrom os.path import isdir 328920Snilay@cs.wisc.edu 337025SBrad.Beckmann@amd.com# Import build environment variable from SConstruct. 349520SAndreas.Sandberg@ARM.comImport('env') 359520SAndreas.Sandberg@ARM.com 369520SAndreas.Sandberg@ARM.com################################################### 379520SAndreas.Sandberg@ARM.com# 389520SAndreas.Sandberg@ARM.com# Define needed sources. 399520SAndreas.Sandberg@ARM.com# 408920Snilay@cs.wisc.edu################################################### 418920Snilay@cs.wisc.edu 429520SAndreas.Sandberg@ARM.com# Base sources used by all configurations. 439520SAndreas.Sandberg@ARM.combase_sources = Split(''' 449520SAndreas.Sandberg@ARM.com faults.cc 458920Snilay@cs.wisc.edu isa_traits.cc 469520SAndreas.Sandberg@ARM.com ''') 478920Snilay@cs.wisc.edu 488920Snilay@cs.wisc.edu# Full-system sources 498920Snilay@cs.wisc.edufull_system_sources = Split(''' 508920Snilay@cs.wisc.edu alpha_memory.cc 518920Snilay@cs.wisc.edu arguments.cc 528920Snilay@cs.wisc.edu ev5.cc 538920Snilay@cs.wisc.edu osfpal.cc 548920Snilay@cs.wisc.edu stacktrace.cc 558920Snilay@cs.wisc.edu vtophys.cc 568920Snilay@cs.wisc.edu ''') 578920Snilay@cs.wisc.edu 588920Snilay@cs.wisc.edu# Syscall emulation (non-full-system) sources 598920Snilay@cs.wisc.edusyscall_emulation_sources = Split(''' 608920Snilay@cs.wisc.edu alpha_common_syscall_emul.cc 618920Snilay@cs.wisc.edu alpha_linux_process.cc 628920Snilay@cs.wisc.edu alpha_tru64_process.cc 638920Snilay@cs.wisc.edu ''') 648920Snilay@cs.wisc.edu 658920Snilay@cs.wisc.edusources = base_sources 668920Snilay@cs.wisc.edu 679197Snilay@cs.wisc.eduif env['FULL_SYSTEM']: 689197Snilay@cs.wisc.edu sources += full_system_sources 699197Snilay@cs.wisc.eduelse: 709197Snilay@cs.wisc.edu sources += syscall_emulation_sources 719197Snilay@cs.wisc.edu 723395Shsul@eecs.umich.edu# Convert file names to SCons File objects. This takes care of the 738920Snilay@cs.wisc.edu# path relative to the top of the directory tree. 748920Snilay@cs.wisc.edusources = [File(s) for s in sources] 758920Snilay@cs.wisc.edu 768920Snilay@cs.wisc.edu# Add in files generated by the ISA description. 778920Snilay@cs.wisc.eduisa_desc_files = env.ISADesc('isa/main.isa') 788920Snilay@cs.wisc.edu# Only non-header files need to be compiled. 798920Snilay@cs.wisc.eduisa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')] 808920Snilay@cs.wisc.edusources += isa_desc_sources 818920Snilay@cs.wisc.edu 828920Snilay@cs.wisc.eduReturn('sources') 838920Snilay@cs.wisc.edu