SConscript revision 4120
14202Sbinkertn@umich.edu# -*- mode:python -*-
24202Sbinkertn@umich.edu
34202Sbinkertn@umich.edu# Copyright (c) 2005-2006 The Regents of The University of Michigan
44202Sbinkertn@umich.edu# All rights reserved.
54202Sbinkertn@umich.edu#
64202Sbinkertn@umich.edu# Redistribution and use in source and binary forms, with or without
74202Sbinkertn@umich.edu# modification, are permitted provided that the following conditions are
84202Sbinkertn@umich.edu# met: redistributions of source code must retain the above copyright
94202Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer;
104202Sbinkertn@umich.edu# redistributions in binary form must reproduce the above copyright
114202Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer in the
124202Sbinkertn@umich.edu# documentation and/or other materials provided with the distribution;
134202Sbinkertn@umich.edu# neither the name of the copyright holders nor the names of its
144202Sbinkertn@umich.edu# contributors may be used to endorse or promote products derived from
154202Sbinkertn@umich.edu# this software without specific prior written permission.
164202Sbinkertn@umich.edu#
174202Sbinkertn@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
184202Sbinkertn@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
194202Sbinkertn@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
204202Sbinkertn@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
214202Sbinkertn@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
224202Sbinkertn@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
234202Sbinkertn@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
244202Sbinkertn@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
254202Sbinkertn@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
264202Sbinkertn@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
274202Sbinkertn@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
284202Sbinkertn@umich.edu#
294202Sbinkertn@umich.edu# Authors: Gabe Black
304202Sbinkertn@umich.edu
314202Sbinkertn@umich.edu# Copyright (c) 2007 The Hewlett-Packard Development Company
324202Sbinkertn@umich.edu# All rights reserved.
339157Sandreas.hansson@arm.com#
3410259SAndrew.Bardsley@arm.com# Redistribution and use of this software in source and binary forms,
354486Sbinkertn@umich.edu# with or without modification, are permitted provided that the
369793Sakash.bagdia@arm.com# following conditions are met:
379827Sakash.bagdia@arm.com#
389850Sandreas.hansson@arm.com# The software must be used only for Non-Commercial Use which means any
3910249Sstephan.diestelhorst@arm.com# use which is NOT directed to receiving any direct monetary
4010268SGeoffrey.Blake@arm.com# compensation for, or commercial advantage from such use.  Illustrative
414486Sbinkertn@umich.edu# examples of non-commercial use are academic research, personal study,
428774Sgblack@eecs.umich.edu# teaching, education and corporate research & development.
434202Sbinkertn@umich.edu# Illustrative examples of commercial use are distributing products for
4411235Sandreas.sandberg@arm.com# commercial advantage and providing services using the software for
454202Sbinkertn@umich.edu# commercial advantage.
4611077SCurtis.Dunham@arm.com#
4710458Sandreas.hansson@arm.com# If you wish to use this software or functionality therein that may be
4810458Sandreas.hansson@arm.com# covered by patents for commercial use, please contact:
4910458Sandreas.hansson@arm.com#     Director of Intellectual Property Licensing
504202Sbinkertn@umich.edu#     Office of Strategy and Technology
5112302Sgabeblack@google.com#     Hewlett-Packard Company
524202Sbinkertn@umich.edu#     1501 Page Mill Road
539983Sstever@gmail.com#     Palo Alto, California  94304
5412302Sgabeblack@google.com#
5510453SAndrew.Bardsley@arm.com# Redistributions of source code must retain the above copyright notice,
5612302Sgabeblack@google.com# this list of conditions and the following disclaimer.  Redistributions
574202Sbinkertn@umich.edu# in binary form must reproduce the above copyright notice, this list of
584202Sbinkertn@umich.edu# conditions and the following disclaimer in the documentation and/or
599342SAndreas.Sandberg@arm.com# other materials provided with the distribution.  Neither the name of
604202Sbinkertn@umich.edu# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
614202Sbinkertn@umich.edu# contributors may be used to endorse or promote products derived from
6210268SGeoffrey.Blake@arm.com# this software without specific prior written permission.  No right of
6310259SAndrew.Bardsley@arm.com# sublicense is granted herewith.  Derivatives of the software and
644202Sbinkertn@umich.edu# output created using the software may be prepared, but only for
654202Sbinkertn@umich.edu# Non-Commercial Uses.  Derivatives of the software may be shared with
6612302Sgabeblack@google.com# others provided: (i) the others agree to abide by the list of
679793Sakash.bagdia@arm.com# conditions herein which includes the Non-Commercial Use restrictions;
689827Sakash.bagdia@arm.com# and (ii) such Derivatives of the software include the above copyright
6911909SBrandon.Potter@amd.com# notice to acknowledge the contribution from this software where
7011420Sdavid.guillen@arm.com# applicable, this list of conditions and the disclaimer below.
719850Sandreas.hansson@arm.com#
7210249Sstephan.diestelhorst@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7311524Sdavid.guillen@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7411527Sdavid.guillen@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
757768SAli.Saidi@ARM.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
769850Sandreas.hansson@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
779850Sandreas.hansson@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
788766Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7911854Sbrandon.potter@amd.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
807768SAli.Saidi@ARM.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
818766Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8211856Sbrandon.potter@amd.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8310930Sbrandon.potter@amd.com#
847768SAli.Saidi@ARM.com# Authors: Gabe Black
859850Sandreas.hansson@arm.com
8611794Sbrandon.potter@amd.comimport os
874486Sbinkertn@umich.eduimport sys
8811800Sbrandon.potter@amd.comfrom os.path import isdir
8911800Sbrandon.potter@amd.com
9011800Sbrandon.potter@amd.com# Import build environment variable from SConstruct.
918335Snate@binkert.orgImport('env')
928335Snate@binkert.org
9310458Sandreas.hansson@arm.com###################################################
949152Satgutier@umich.edu#
958335Snate@binkert.org# Define needed sources.
968335Snate@binkert.org#
978335Snate@binkert.org###################################################
988335Snate@binkert.org
998335Snate@binkert.org# Base sources used by all configurations.
1008335Snate@binkert.orgbase_sources = Split('''
1018335Snate@binkert.org	''')
1029733Sandreas@sandberg.pp.se
1038335Snate@binkert.org# Full-system sources
10411380Salexandru.dutu@amd.comfull_system_sources = Split('''
1058335Snate@binkert.org	''')
1068335Snate@binkert.org
1078335Snate@binkert.org# Syscall emulation (non-full-system) sources
1088335Snate@binkert.orgsyscall_emulation_sources = Split('''
1098335Snate@binkert.org	''')
1108335Snate@binkert.org
1119793Sakash.bagdia@arm.comsources = base_sources
1129827Sakash.bagdia@arm.com
11310249Sstephan.diestelhorst@arm.comif env['FULL_SYSTEM']:
11411380Salexandru.dutu@amd.com    sources += full_system_sources
11511380Salexandru.dutu@amd.comelse:
116    sources += syscall_emulation_sources
117
118# Convert file names to SCons File objects.  This takes care of the
119# path relative to the top of the directory tree.
120sources = [File(s) for s in sources]
121
122# Add in files generated by the ISA description.
123isa_desc_files = env.ISADesc('isa/main.isa')
124# Only non-header files need to be compiled.
125isa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
126sources += isa_desc_sources
127
128Return('sources')
129