SConscript revision 3546:c4074658f1e1
112771Sqtt2@cornell.edu# -*- mode:python -*-
212771Sqtt2@cornell.edu
312771Sqtt2@cornell.edu# Copyright (c) 2006 The Regents of The University of Michigan
412771Sqtt2@cornell.edu# All rights reserved.
512771Sqtt2@cornell.edu#
612771Sqtt2@cornell.edu# Redistribution and use in source and binary forms, with or without
712771Sqtt2@cornell.edu# modification, are permitted provided that the following conditions are
812771Sqtt2@cornell.edu# met: redistributions of source code must retain the above copyright
912771Sqtt2@cornell.edu# notice, this list of conditions and the following disclaimer;
1012771Sqtt2@cornell.edu# redistributions in binary form must reproduce the above copyright
1112771Sqtt2@cornell.edu# notice, this list of conditions and the following disclaimer in the
1212771Sqtt2@cornell.edu# documentation and/or other materials provided with the distribution;
1312771Sqtt2@cornell.edu# neither the name of the copyright holders nor the names of its
1412771Sqtt2@cornell.edu# contributors may be used to endorse or promote products derived from
1512771Sqtt2@cornell.edu# this software without specific prior written permission.
1612771Sqtt2@cornell.edu#
1712771Sqtt2@cornell.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1812771Sqtt2@cornell.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1912771Sqtt2@cornell.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2012771Sqtt2@cornell.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2112771Sqtt2@cornell.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2212771Sqtt2@cornell.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2312771Sqtt2@cornell.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2412771Sqtt2@cornell.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2512771Sqtt2@cornell.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2612771Sqtt2@cornell.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2712771Sqtt2@cornell.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2812771Sqtt2@cornell.edu#
2912771Sqtt2@cornell.edu# Authors: Steve Reinhardt
3012771Sqtt2@cornell.edu
3112771Sqtt2@cornell.eduimport os.path, sys
3212771Sqtt2@cornell.edu
3312771Sqtt2@cornell.edu# Import build environment variable from SConstruct.
3412771Sqtt2@cornell.eduImport('env')
3512771Sqtt2@cornell.edu
3612771Sqtt2@cornell.edusources = Split('''
3712771Sqtt2@cornell.edu	base_kernel_stats.cc
3812771Sqtt2@cornell.edu	system_events.cc
3912771Sqtt2@cornell.edu	linux/events.cc
4012771Sqtt2@cornell.edu	linux/linux_syscalls.cc
4112771Sqtt2@cornell.edu	linux/printk.cc
4212771Sqtt2@cornell.edu	''')
4312771Sqtt2@cornell.edu
4412771Sqtt2@cornell.edu# Convert file names to SCons File objects.  This takes care of the
4512771Sqtt2@cornell.edu# path relative to the top of the directory tree.
4612771Sqtt2@cornell.edusources = [File(s) for s in sources]
4712771Sqtt2@cornell.edu
4812771Sqtt2@cornell.edu#################################################################
4912771Sqtt2@cornell.edu#
5012771Sqtt2@cornell.edu# ISA "switch header" generation.
5112771Sqtt2@cornell.edu#
5212771Sqtt2@cornell.edu# Auto-generate arch headers that include the right ISA-specific
5312771Sqtt2@cornell.edu# header based on the setting of THE_ISA preprocessor variable.
5412771Sqtt2@cornell.edu#
5512771Sqtt2@cornell.edu#################################################################
5612771Sqtt2@cornell.edu
5712771Sqtt2@cornell.edu# List of headers to generate
5812771Sqtt2@cornell.edukern_switch_hdrs = Split('''
5912771Sqtt2@cornell.edu        kernel_stats.hh
6012771Sqtt2@cornell.edu        ''')
6112771Sqtt2@cornell.edu
6212771Sqtt2@cornell.eduenv.make_switching_dir('kern', kern_switch_hdrs, env)
6312771Sqtt2@cornell.edu
6412771Sqtt2@cornell.eduisa = env['TARGET_ISA'] # someday this may be a list of ISAs
6512771Sqtt2@cornell.edu
6612771Sqtt2@cornell.edu# Let the target architecture define what additional sources it needs
6712771Sqtt2@cornell.edusources += SConscript(os.path.join(isa, 'SConscript'), exports = 'env')
6812771Sqtt2@cornell.edu
6912771Sqtt2@cornell.eduReturn('sources')
7012771Sqtt2@cornell.edu