SConscript revision 4120
1# -*- mode:python -*- 2 3# Copyright (c) 2005-2006 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright 9# notice, this list of conditions and the following disclaimer; 10# redistributions in binary form must reproduce the above copyright 11# notice, this list of conditions and the following disclaimer in the 12# documentation and/or other materials provided with the distribution; 13# neither the name of the copyright holders nor the names of its 14# contributors may be used to endorse or promote products derived from 15# this software without specific prior written permission. 16# 17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28# 29# Authors: Gabe Black 30 31# Copyright (c) 2007 The Hewlett-Packard Development Company 32# All rights reserved. 33# 34# Redistribution and use of this software in source and binary forms, 35# with or without modification, are permitted provided that the 36# following conditions are met: 37# 38# The software must be used only for Non-Commercial Use which means any 39# use which is NOT directed to receiving any direct monetary 40# compensation for, or commercial advantage from such use. Illustrative 41# examples of non-commercial use are academic research, personal study, 42# teaching, education and corporate research & development. 43# Illustrative examples of commercial use are distributing products for 44# commercial advantage and providing services using the software for 45# commercial advantage. 46# 47# If you wish to use this software or functionality therein that may be 48# covered by patents for commercial use, please contact: 49# Director of Intellectual Property Licensing 50# Office of Strategy and Technology 51# Hewlett-Packard Company 52# 1501 Page Mill Road 53# Palo Alto, California 94304 54# 55# Redistributions of source code must retain the above copyright notice, 56# this list of conditions and the following disclaimer. Redistributions 57# in binary form must reproduce the above copyright notice, this list of 58# conditions and the following disclaimer in the documentation and/or 59# other materials provided with the distribution. Neither the name of 60# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 61# contributors may be used to endorse or promote products derived from 62# this software without specific prior written permission. No right of 63# sublicense is granted herewith. Derivatives of the software and 64# output created using the software may be prepared, but only for 65# Non-Commercial Uses. Derivatives of the software may be shared with 66# others provided: (i) the others agree to abide by the list of 67# conditions herein which includes the Non-Commercial Use restrictions; 68# and (ii) such Derivatives of the software include the above copyright 69# notice to acknowledge the contribution from this software where 70# applicable, this list of conditions and the disclaimer below. 71# 72# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 73# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 74# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 75# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 76# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 77# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 78# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 79# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 80# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 81# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 82# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 83# 84# Authors: Gabe Black 85 86import os 87import sys 88from os.path import isdir 89 90# Import build environment variable from SConstruct. 91Import('env') 92 93################################################### 94# 95# Define needed sources. 96# 97################################################### 98 99# Base sources used by all configurations. 100base_sources = Split(''' 101 ''') 102 103# Full-system sources 104full_system_sources = Split(''' 105 ''') 106 107# Syscall emulation (non-full-system) sources 108syscall_emulation_sources = Split(''' 109 ''') 110 111sources = base_sources 112 113if env['FULL_SYSTEM']: 114 sources += full_system_sources 115else: 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