SConscript revision 4773
1955SN/A# -*- mode:python -*-
2955SN/A
31762SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan
4955SN/A# All rights reserved.
5955SN/A#
6955SN/A# Redistribution and use in source and binary forms, with or without
7955SN/A# modification, are permitted provided that the following conditions are
8955SN/A# met: redistributions of source code must retain the above copyright
9955SN/A# notice, this list of conditions and the following disclaimer;
10955SN/A# redistributions in binary form must reproduce the above copyright
11955SN/A# notice, this list of conditions and the following disclaimer in the
12955SN/A# documentation and/or other materials provided with the distribution;
13955SN/A# neither the name of the copyright holders nor the names of its
14955SN/A# contributors may be used to endorse or promote products derived from
15955SN/A# this software without specific prior written permission.
16955SN/A#
17955SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18955SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19955SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20955SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21955SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22955SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23955SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24955SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25955SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26955SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27955SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282665Ssaidi@eecs.umich.edu#
294762Snate@binkert.org# Authors: Nathan Binkert
30955SN/A
315522Snate@binkert.orgimport imp
324762Snate@binkert.orgimport os
335522Snate@binkert.orgimport sys
34955SN/A
355522Snate@binkert.orgfrom os.path import basename
36955SN/Afrom os.path import join as joinpath
375522Snate@binkert.orgfrom os.path import exists
384202Sbinkertn@umich.edufrom os.path import isdir
395742Snate@binkert.orgfrom os.path import isfile
40955SN/A
414381Sbinkertn@umich.eduimport SCons
424381Sbinkertn@umich.edu
43955SN/A# This file defines how to build a particular configuration of M5
44955SN/A# based on variable settings in the 'env' build environment.
45955SN/A
464202Sbinkertn@umich.eduImport('*')
47955SN/A
484382Sbinkertn@umich.edu# Children need to see the environment
494382Sbinkertn@umich.eduExport('env')
504382Sbinkertn@umich.edu
515517Snate@binkert.orgdef sort_list(_list):
525517Snate@binkert.org    """return a sorted copy of '_list'"""
534762Snate@binkert.org    if isinstance(_list, list):
544762Snate@binkert.org        _list = _list[:]
554762Snate@binkert.org    else:
564762Snate@binkert.org        _list = list(_list)
574762Snate@binkert.org    _list.sort()
584762Snate@binkert.org    return _list
594762Snate@binkert.org
604762Snate@binkert.orgclass PySourceFile(object):
614762Snate@binkert.org    def __init__(self, package, source):
624762Snate@binkert.org        filename = str(source)
635522Snate@binkert.org        pyname = basename(filename)
645604Snate@binkert.org        assert pyname.endswith('.py')
655604Snate@binkert.org        name = pyname[:-3]
665604Snate@binkert.org        path = package.split('.')
674762Snate@binkert.org        modpath = path
684762Snate@binkert.org        if name != '__init__':
694762Snate@binkert.org            modpath += [name]
705522Snate@binkert.org        modpath = '.'.join(modpath)
715522Snate@binkert.org
725522Snate@binkert.org        arcpath = package.split('.') + [ pyname + 'c' ]
735522Snate@binkert.org        arcname = joinpath(*arcpath)
745604Snate@binkert.org
755604Snate@binkert.org        self.source = source
764762Snate@binkert.org        self.pyname = pyname
774762Snate@binkert.org        self.srcpath = source.srcnode().abspath
784762Snate@binkert.org        self.package = package
794762Snate@binkert.org        self.modpath = modpath
805522Snate@binkert.org        self.arcname = arcname
814762Snate@binkert.org        self.filename = filename
824762Snate@binkert.org        self.compiled = File(filename + 'c')
835604Snate@binkert.org
845604Snate@binkert.org########################################################################
855604Snate@binkert.org# Code for adding source files of various types
865604Snate@binkert.org#
875604Snate@binkert.orgcc_sources = []
885604Snate@binkert.orgdef Source(source):
894762Snate@binkert.org    '''Add a C/C++ source file to the build'''
904762Snate@binkert.org    if not isinstance(source, SCons.Node.FS.File):
914762Snate@binkert.org        source = File(source)
924762Snate@binkert.org
935604Snate@binkert.org    cc_sources.append(source)
944762Snate@binkert.org
955522Snate@binkert.orgpy_sources = []
965522Snate@binkert.orgdef PySource(package, source):
975522Snate@binkert.org    '''Add a python source file to the named package'''
984762Snate@binkert.org    if not isinstance(source, SCons.Node.FS.File):
994382Sbinkertn@umich.edu        source = File(source)
1004762Snate@binkert.org
1014382Sbinkertn@umich.edu    source = PySourceFile(package, source)
1025522Snate@binkert.org    py_sources.append(source)
1034381Sbinkertn@umich.edu
1045522Snate@binkert.orgsim_objects_fixed = False
1054762Snate@binkert.orgsim_object_modfiles = set()
1064762Snate@binkert.orgdef SimObject(source):
1074762Snate@binkert.org    '''Add a SimObject python file as a python source object and add
1085522Snate@binkert.org    it to a list of sim object modules'''
1095522Snate@binkert.org
1105522Snate@binkert.org    if sim_objects_fixed:
1115522Snate@binkert.org        raise AttributeError, "Too late to call SimObject now."
1125522Snate@binkert.org
1135522Snate@binkert.org    if not isinstance(source, SCons.Node.FS.File):
1145522Snate@binkert.org        source = File(source)
1155522Snate@binkert.org
1165522Snate@binkert.org    PySource('m5.objects', source)
1174762Snate@binkert.org    modfile = basename(str(source))
1184762Snate@binkert.org    assert modfile.endswith('.py')
1194762Snate@binkert.org    modname = modfile[:-3]
1204762Snate@binkert.org    sim_object_modfiles.add(modname)
1214762Snate@binkert.org
1224762Snate@binkert.orgswig_sources = []
1234762Snate@binkert.orgdef SwigSource(package, source):
1244762Snate@binkert.org    '''Add a swig file to build'''
1254762Snate@binkert.org    if not isinstance(source, SCons.Node.FS.File):
1264762Snate@binkert.org        source = File(source)
1274762Snate@binkert.org    val = source,package
1284762Snate@binkert.org    swig_sources.append(val)
1294762Snate@binkert.org
1304762Snate@binkert.org# Children should have access
1314762Snate@binkert.orgExport('Source')
1324762Snate@binkert.orgExport('PySource')
1334762Snate@binkert.orgExport('SimObject')
1344762Snate@binkert.orgExport('SwigSource')
1354762Snate@binkert.org
1364762Snate@binkert.org########################################################################
1374762Snate@binkert.org#
1384762Snate@binkert.org# Set some compiler variables
1394762Snate@binkert.org#
1404762Snate@binkert.org
1414762Snate@binkert.org# Include file paths are rooted in this directory.  SCons will
1424762Snate@binkert.org# automatically expand '.' to refer to both the source directory and
1434762Snate@binkert.org# the corresponding build directory to pick up generated include
1444762Snate@binkert.org# files.
1454762Snate@binkert.orgenv.Append(CPPPATH=Dir('.'))
1464762Snate@binkert.org
1474762Snate@binkert.org# Add a flag defining what THE_ISA should be for all compilation
1484762Snate@binkert.orgenv.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())])
1494762Snate@binkert.org
1504762Snate@binkert.org########################################################################
1514762Snate@binkert.org#
152955SN/A# Walk the tree and execute all SConscripts
1535584Snate@binkert.org#
1545584Snate@binkert.orgsrcdir = env['SRCDIR']
1555584Snate@binkert.orgfor root, dirs, files in os.walk(srcdir, topdown=True):
1565584Snate@binkert.org    if root == srcdir:
1575584Snate@binkert.org        # we don't want to recurse back into this SConscript
1585584Snate@binkert.org        continue
1595584Snate@binkert.org
1605584Snate@binkert.org    if 'SConscript' in files:
1615584Snate@binkert.org        # strip off the srcdir part since scons will try to find the
1625584Snate@binkert.org        # script in the build directory
1635584Snate@binkert.org        base = root[len(srcdir) + 1:]
1645584Snate@binkert.org        SConscript(joinpath(base, 'SConscript'))
1655584Snate@binkert.org
1664382Sbinkertn@umich.edufor extra in env['EXTRAS'].split(':'):
1674202Sbinkertn@umich.edu    extra = os.path.expanduser(extra)
1685522Snate@binkert.org    env.Append(CPPPATH=[Dir(extra)])
1694382Sbinkertn@umich.edu    for root, dirs, files in os.walk(extra, topdown=True):
1704382Sbinkertn@umich.edu        if 'SConscript' in files:
1714382Sbinkertn@umich.edu            subdir = root[len(os.path.dirname(extra))+1:]
1725584Snate@binkert.org            build_dir = joinpath(env['BUILDDIR'], subdir)
1734382Sbinkertn@umich.edu            SConscript(joinpath(root, 'SConscript'), build_dir=build_dir)
1744382Sbinkertn@umich.edu
1754382Sbinkertn@umich.edufor opt in env.ExportOptions:
1765192Ssaidi@eecs.umich.edu    env.ConfigFile(opt)
1775192Ssaidi@eecs.umich.edu
1785799Snate@binkert.org########################################################################
1795799Snate@binkert.org#
1805799Snate@binkert.org# Prevent any SimObjects from being added after this point, they
1815192Ssaidi@eecs.umich.edu# should all have been added in the SConscripts above
1825799Snate@binkert.org#
1835192Ssaidi@eecs.umich.edusim_objects_fixed = True
1845799Snate@binkert.org
1855799Snate@binkert.org########################################################################
1865192Ssaidi@eecs.umich.edu#
1875192Ssaidi@eecs.umich.edu# Manually turn python/generate.py into a python module and import it
1885192Ssaidi@eecs.umich.edu#
1895192Ssaidi@eecs.umich.edugenerate_file = File('python/generate.py')
1905799Snate@binkert.orggenerate_module = imp.new_module('generate')
1915192Ssaidi@eecs.umich.edusys.modules['generate'] = generate_module
1925799Snate@binkert.orgexec file(generate_file.srcnode().abspath, 'r') in generate_module.__dict__
1935192Ssaidi@eecs.umich.edu
1945192Ssaidi@eecs.umich.edu########################################################################
1955192Ssaidi@eecs.umich.edu#
1965799Snate@binkert.org# build a generate
1975192Ssaidi@eecs.umich.edu#
1985192Ssaidi@eecs.umich.edufrom generate import Generate
1995192Ssaidi@eecs.umich.eduoptionDict = dict([(opt, env[opt]) for opt in env.ExportOptions])
2005192Ssaidi@eecs.umich.edugenerate = Generate(py_sources, sim_object_modfiles, optionDict)
2015192Ssaidi@eecs.umich.edum5 = generate.m5
2025192Ssaidi@eecs.umich.edu
2034382Sbinkertn@umich.edu########################################################################
2044382Sbinkertn@umich.edu#
2054382Sbinkertn@umich.edu# calculate extra dependencies
2062667Sstever@eecs.umich.edu#
2072667Sstever@eecs.umich.edumodule_depends = ["m5", "m5.SimObject", "m5.params"]
2082667Sstever@eecs.umich.edumodule_depends = [ File(generate.py_modules[dep]) for dep in module_depends ]
2092667Sstever@eecs.umich.edufile_depends = [ generate_file ]
2102667Sstever@eecs.umich.edudepends = module_depends + file_depends
2112667Sstever@eecs.umich.edu
2125742Snate@binkert.org########################################################################
2135742Snate@binkert.org#
2145742Snate@binkert.org# Commands for the basic automatically generated python files
2152037SN/A#
2162037SN/A
2172037SN/A# Generate a file with all of the compile options in it
2185793Snate@binkert.orgenv.Command('python/m5/defines.py', Value(optionDict),
2195793Snate@binkert.org            generate.makeDefinesPyFile)
2205793Snate@binkert.orgPySource('m5', 'python/m5/defines.py')
2215793Snate@binkert.org
2225793Snate@binkert.org# Generate a file that wraps the basic top level files
2234382Sbinkertn@umich.eduenv.Command('python/m5/info.py',
2244762Snate@binkert.org            [ '#/AUTHORS', '#/LICENSE', '#/README', '#/RELEASE_NOTES' ],
2255344Sstever@gmail.com            generate.makeInfoPyFile)
2264382Sbinkertn@umich.eduPySource('m5', 'python/m5/info.py')
2275341Sstever@gmail.com
2285742Snate@binkert.org# Generate an __init__.py file for the objects package
2295742Snate@binkert.orgenv.Command('python/m5/objects/__init__.py',
2305742Snate@binkert.org            [ Value(o) for o in sort_list(sim_object_modfiles) ],
2315742Snate@binkert.org            generate.makeObjectsInitFile)
2325742Snate@binkert.orgPySource('m5.objects', 'python/m5/objects/__init__.py')
2334762Snate@binkert.org
2345742Snate@binkert.org########################################################################
2355742Snate@binkert.org#
2365742Snate@binkert.org# Create all of the SimObject param headers and enum headers
2375742Snate@binkert.org#
2385742Snate@binkert.org
2395742Snate@binkert.org# Generate all of the SimObject param struct header files
2405742Snate@binkert.orgparams_hh_files = []
2415341Sstever@gmail.comfor name,simobj in generate.sim_objects.iteritems():
2425742Snate@binkert.org    extra_deps = [ File(generate.py_modules[simobj.__module__]) ]
2435341Sstever@gmail.com
2444773Snate@binkert.org    hh_file = File('params/%s.hh' % name)
2451858SN/A    params_hh_files.append(hh_file)
2461858SN/A    env.Command(hh_file, Value(name), generate.createSimObjectParam)
2471085SN/A    env.Depends(hh_file, depends + extra_deps)
2484382Sbinkertn@umich.edu
2494382Sbinkertn@umich.edu# Generate any parameter header files needed
2504762Snate@binkert.orgfor name,param in generate.params.iteritems():
2514762Snate@binkert.org    if isinstance(param, m5.params.VectorParamDesc):
2524762Snate@binkert.org        ext = 'vptype'
2535517Snate@binkert.org    else:
2545517Snate@binkert.org        ext = 'ptype'
2555517Snate@binkert.org
2565517Snate@binkert.org    i_file = File('params/%s_%s.i' % (name, ext))
2575517Snate@binkert.org    env.Command(i_file, Value(name), generate.createSwigParam)
2585517Snate@binkert.org    env.Depends(i_file, depends)
2595517Snate@binkert.org
2605517Snate@binkert.org# Generate all enum header files
2615517Snate@binkert.orgfor name,enum in generate.enums.iteritems():
2625517Snate@binkert.org    extra_deps = [ File(generate.py_modules[enum.__module__]) ]
2635517Snate@binkert.org
2645517Snate@binkert.org    cc_file = File('enums/%s.cc' % name)
2655517Snate@binkert.org    env.Command(cc_file, Value(name), generate.createEnumStrings)
2665517Snate@binkert.org    env.Depends(cc_file, depends + extra_deps)
2675517Snate@binkert.org    Source(cc_file)
2685517Snate@binkert.org
2695517Snate@binkert.org    hh_file = File('enums/%s.hh' % name)
2705798Snate@binkert.org    env.Command(hh_file, Value(name), generate.createEnumParam)
2715517Snate@binkert.org    env.Depends(hh_file, depends + extra_deps)
2725517Snate@binkert.org
2735517Snate@binkert.org# Build the big monolithic swigged params module (wraps all SimObject
2745517Snate@binkert.org# param structs and enum structs)
2755517Snate@binkert.orgparams_file = File('params/params.i')
2765517Snate@binkert.orgnames = sort_list(generate.sim_objects.keys())
2775517Snate@binkert.orgenv.Command(params_file, [ Value(v) for v in names ],
2785517Snate@binkert.org            generate.buildParams)
2795517Snate@binkert.orgenv.Depends(params_file, params_hh_files + depends)
2805517Snate@binkert.orgSwigSource('m5.objects', params_file)
2815517Snate@binkert.org
2825517Snate@binkert.org# Build all swig modules
2835517Snate@binkert.orgswig_modules = []
2845517Snate@binkert.orgfor source,package in swig_sources:
2855517Snate@binkert.org    filename = str(source)
2865517Snate@binkert.org    assert filename.endswith('.i')
2875517Snate@binkert.org
2885517Snate@binkert.org    base = '.'.join(filename.split('.')[:-1])
2895517Snate@binkert.org    module = basename(base)
2905517Snate@binkert.org    cc_file = base + '_wrap.cc'
2915517Snate@binkert.org    py_file = base + '.py'
2925517Snate@binkert.org
2935517Snate@binkert.org    env.Command([cc_file, py_file], source,
2945798Snate@binkert.org                '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
2955798Snate@binkert.org                '-o ${TARGETS[0]} $SOURCES')
2965517Snate@binkert.org    env.Depends(py_file, source)
2975517Snate@binkert.org    env.Depends(cc_file, source)
2985517Snate@binkert.org
2995517Snate@binkert.org    swig_modules.append(Value(module))
3005517Snate@binkert.org    Source(cc_file)
3015517Snate@binkert.org    PySource(package, py_file)
3025517Snate@binkert.org
3035517Snate@binkert.org# Generate the main swig init file
3045517Snate@binkert.orgenv.Command('swig/init.cc', swig_modules, generate.makeSwigInit)
3055517Snate@binkert.orgSource('swig/init.cc')
3065517Snate@binkert.org
3075517Snate@binkert.org# Build the zip file
3085517Snate@binkert.orgpy_compiled = []
3095522Snate@binkert.orgpy_zip_depends = []
3105517Snate@binkert.orgfor source in py_sources:
3115517Snate@binkert.org    env.Command(source.compiled, source.source, generate.compilePyFile)
3125517Snate@binkert.org    py_compiled.append(source.compiled)
3135517Snate@binkert.org
3144762Snate@binkert.org    # make the zipfile depend on the archive name so that the archive
3155517Snate@binkert.org    # is rebuilt if the name changes
3165517Snate@binkert.org    py_zip_depends.append(Value(source.arcname))
3174762Snate@binkert.org
3185517Snate@binkert.org# Add the zip file target to the environment.
3194762Snate@binkert.orgm5zip = File('m5py.zip')
3205517Snate@binkert.orgenv.Command(m5zip, py_compiled, generate.buildPyZip)
3215517Snate@binkert.orgenv.Depends(m5zip, py_zip_depends)
3225517Snate@binkert.org
3235517Snate@binkert.org########################################################################
3245517Snate@binkert.org#
3255517Snate@binkert.org# Define binaries.  Each different build type (debug, opt, etc.) gets
3265517Snate@binkert.org# a slightly different build environment.
3275517Snate@binkert.org#
3285517Snate@binkert.org
3295517Snate@binkert.org# List of constructed environments to pass back to SConstruct
3305517Snate@binkert.orgenvList = []
3315517Snate@binkert.org
3325517Snate@binkert.org# This function adds the specified sources to the given build
3335517Snate@binkert.org# environment, and returns a list of all the corresponding SCons
3345517Snate@binkert.org# Object nodes (including an extra one for date.cc).  We explicitly
3355517Snate@binkert.org# add the Object nodes so we can set up special dependencies for
3365517Snate@binkert.org# date.cc.
3375517Snate@binkert.orgdef make_objs(sources, env):
3385517Snate@binkert.org    objs = [env.Object(s) for s in sources]
3395517Snate@binkert.org    # make date.cc depend on all other objects so it always gets
3405517Snate@binkert.org    # recompiled whenever anything else does
3415517Snate@binkert.org    date_obj = env.Object('base/date.cc')
3425517Snate@binkert.org    env.Depends(date_obj, objs)
3434762Snate@binkert.org    objs.append(date_obj)
3444762Snate@binkert.org    return objs
3454762Snate@binkert.org
3464762Snate@binkert.org# Function to create a new build environment as clone of current
3474762Snate@binkert.org# environment 'env' with modified object suffix and optional stripped
3484762Snate@binkert.org# binary.  Additional keyword arguments are appended to corresponding
3495517Snate@binkert.org# build environment vars.
3504762Snate@binkert.orgdef makeEnv(label, objsfx, strip = False, **kwargs):
3514762Snate@binkert.org    newEnv = env.Copy(OBJSUFFIX=objsfx)
3524762Snate@binkert.org    newEnv.Label = label
3534762Snate@binkert.org    newEnv.Append(**kwargs)
3544382Sbinkertn@umich.edu    exe = 'm5.' + label  # final executable
3554382Sbinkertn@umich.edu    bin = exe + '.bin'   # executable w/o appended Python zip archive
3565798Snate@binkert.org    newEnv.Program(bin, make_objs(cc_sources, newEnv))
3575798Snate@binkert.org    if strip:
3585798Snate@binkert.org        stripped_bin = bin + '.stripped'
3595798Snate@binkert.org        if sys.platform == 'sunos5':
3605798Snate@binkert.org            cmd = 'cp $SOURCE $TARGET; strip $TARGET'
3615798Snate@binkert.org        else:
3625798Snate@binkert.org            cmd = 'strip $SOURCE -o $TARGET'
3635798Snate@binkert.org        newEnv.Command(stripped_bin, bin, cmd)
3645798Snate@binkert.org        bin = stripped_bin
3655798Snate@binkert.org    targets = newEnv.Concat(exe, [bin, 'm5py.zip'])
3665798Snate@binkert.org    newEnv.M5Binary = targets[0]
3675798Snate@binkert.org    envList.append(newEnv)
3685798Snate@binkert.org
3695798Snate@binkert.org# Debug binary
3705798Snate@binkert.orgccflags = {}
3715798Snate@binkert.orgif env['GCC']:
3725798Snate@binkert.org    if sys.platform == 'sunos5':
3735798Snate@binkert.org        ccflags['debug'] = '-gstabs+'
3745798Snate@binkert.org    else:
3755798Snate@binkert.org        ccflags['debug'] = '-ggdb3'
3765798Snate@binkert.org    ccflags['opt'] = '-g -O3'
3775798Snate@binkert.org    ccflags['fast'] = '-O3'
3785798Snate@binkert.org    ccflags['prof'] = '-O3 -g -pg'
3795798Snate@binkert.orgelif env['SUNCC']:
3805798Snate@binkert.org    ccflags['debug'] = '-g0'
3815798Snate@binkert.org    ccflags['opt'] = '-g -O'
3825798Snate@binkert.org    ccflags['fast'] = '-fast'
3835798Snate@binkert.org    ccflags['prof'] = '-fast -g -pg'
3845798Snate@binkert.orgelif env['ICC']:
3855798Snate@binkert.org    ccflags['debug'] = '-g -O0'
3865798Snate@binkert.org    ccflags['opt'] = '-g -O'
3875517Snate@binkert.org    ccflags['fast'] = '-fast'
3885517Snate@binkert.org    ccflags['prof'] = '-fast -g -pg'
3895517Snate@binkert.orgelse:
3905517Snate@binkert.org    print 'Unknown compiler, please fix compiler options'
3915798Snate@binkert.org    Exit(1)
3925798Snate@binkert.org
3935798Snate@binkert.orgmakeEnv('debug', '.do',
3945517Snate@binkert.org        CCFLAGS = Split(ccflags['debug']),
3955517Snate@binkert.org        CPPDEFINES = ['DEBUG', 'TRACING_ON=1'])
3965798Snate@binkert.org
3975798Snate@binkert.org# Optimized binary
3985798Snate@binkert.orgmakeEnv('opt', '.o',
3995798Snate@binkert.org        CCFLAGS = Split(ccflags['opt']),
4005798Snate@binkert.org        CPPDEFINES = ['TRACING_ON=1'])
4015517Snate@binkert.org
4025517Snate@binkert.org# "Fast" binary
4035517Snate@binkert.orgmakeEnv('fast', '.fo', strip = True,
4045517Snate@binkert.org        CCFLAGS = Split(ccflags['fast']),
4055517Snate@binkert.org        CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'])
4065517Snate@binkert.org
4075517Snate@binkert.org# Profiled binary
4085517Snate@binkert.orgmakeEnv('prof', '.po',
4095798Snate@binkert.org        CCFLAGS = Split(ccflags['prof']),
4105798Snate@binkert.org        CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
4115798Snate@binkert.org        LINKFLAGS = '-pg')
4125798Snate@binkert.org
4135798Snate@binkert.orgReturn('envList')
4145798Snate@binkert.org