SConscript revision 4776
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
326143Snate@binkert.orgimport os
334762Snate@binkert.orgimport sys
345522Snate@binkert.org
35955SN/Afrom os.path import basename
365522Snate@binkert.orgfrom os.path import join as joinpath
37955SN/Afrom os.path import exists
385522Snate@binkert.orgfrom os.path import isdir
394202Sbinkertn@umich.edufrom os.path import isfile
405742Snate@binkert.org
41955SN/Aimport SCons
424381Sbinkertn@umich.edu
434381Sbinkertn@umich.edu# This file defines how to build a particular configuration of M5
448334Snate@binkert.org# based on variable settings in the 'env' build environment.
45955SN/A
46955SN/AImport('*')
474202Sbinkertn@umich.edu
48955SN/A# Children need to see the environment
494382Sbinkertn@umich.eduExport('env')
504382Sbinkertn@umich.edu
514382Sbinkertn@umich.edudef sort_list(_list):
526654Snate@binkert.org    """return a sorted copy of '_list'"""
535517Snate@binkert.org    if isinstance(_list, list):
548614Sgblack@eecs.umich.edu        _list = _list[:]
557674Snate@binkert.org    else:
566143Snate@binkert.org        _list = list(_list)
576143Snate@binkert.org    _list.sort()
586143Snate@binkert.org    return _list
598233Snate@binkert.org
608233Snate@binkert.orgclass PySourceFile(object):
618233Snate@binkert.org    def __init__(self, package, source):
628233Snate@binkert.org        filename = str(source)
638233Snate@binkert.org        pyname = basename(filename)
648334Snate@binkert.org        assert pyname.endswith('.py')
658334Snate@binkert.org        name = pyname[:-3]
668233Snate@binkert.org        path = package.split('.')
678233Snate@binkert.org        modpath = path
688233Snate@binkert.org        if name != '__init__':
698233Snate@binkert.org            modpath += [name]
708233Snate@binkert.org        modpath = '.'.join(modpath)
718233Snate@binkert.org
726143Snate@binkert.org        arcpath = package.split('.') + [ pyname + 'c' ]
738233Snate@binkert.org        arcname = joinpath(*arcpath)
748233Snate@binkert.org
758233Snate@binkert.org        self.source = source
766143Snate@binkert.org        self.pyname = pyname
776143Snate@binkert.org        self.srcpath = source.srcnode().abspath
786143Snate@binkert.org        self.package = package
796143Snate@binkert.org        self.modpath = modpath
808233Snate@binkert.org        self.arcname = arcname
818233Snate@binkert.org        self.filename = filename
828233Snate@binkert.org        self.compiled = File(filename + 'c')
836143Snate@binkert.org
848233Snate@binkert.org########################################################################
858233Snate@binkert.org# Code for adding source files of various types
868233Snate@binkert.org#
878233Snate@binkert.orgcc_sources = []
886143Snate@binkert.orgdef Source(source):
896143Snate@binkert.org    '''Add a C/C++ source file to the build'''
906143Snate@binkert.org    if not isinstance(source, SCons.Node.FS.File):
914762Snate@binkert.org        source = File(source)
926143Snate@binkert.org
938233Snate@binkert.org    cc_sources.append(source)
948233Snate@binkert.org
958233Snate@binkert.orgpy_sources = []
968233Snate@binkert.orgdef PySource(package, source):
978233Snate@binkert.org    '''Add a python source file to the named package'''
986143Snate@binkert.org    if not isinstance(source, SCons.Node.FS.File):
998233Snate@binkert.org        source = File(source)
1008233Snate@binkert.org
1018233Snate@binkert.org    source = PySourceFile(package, source)
1028233Snate@binkert.org    py_sources.append(source)
1036143Snate@binkert.org
1046143Snate@binkert.orgsim_objects_fixed = False
1056143Snate@binkert.orgsim_object_modfiles = set()
1066143Snate@binkert.orgdef SimObject(source):
1076143Snate@binkert.org    '''Add a SimObject python file as a python source object and add
1086143Snate@binkert.org    it to a list of sim object modules'''
1096143Snate@binkert.org
1106143Snate@binkert.org    if sim_objects_fixed:
1116143Snate@binkert.org        raise AttributeError, "Too late to call SimObject now."
1127065Snate@binkert.org
1136143Snate@binkert.org    if not isinstance(source, SCons.Node.FS.File):
1148233Snate@binkert.org        source = File(source)
1158233Snate@binkert.org
1168233Snate@binkert.org    PySource('m5.objects', source)
1178233Snate@binkert.org    modfile = basename(str(source))
1188233Snate@binkert.org    assert modfile.endswith('.py')
1198233Snate@binkert.org    modname = modfile[:-3]
1208233Snate@binkert.org    sim_object_modfiles.add(modname)
1218233Snate@binkert.org
1228233Snate@binkert.orgswig_sources = []
1238233Snate@binkert.orgdef SwigSource(package, source):
1248233Snate@binkert.org    '''Add a swig file to build'''
1258233Snate@binkert.org    if not isinstance(source, SCons.Node.FS.File):
1268233Snate@binkert.org        source = File(source)
1278233Snate@binkert.org    val = source,package
1288233Snate@binkert.org    swig_sources.append(val)
1298233Snate@binkert.org
1308233Snate@binkert.org# Children should have access
1318233Snate@binkert.orgExport('Source')
1328233Snate@binkert.orgExport('PySource')
1338233Snate@binkert.orgExport('SimObject')
1348233Snate@binkert.orgExport('SwigSource')
1358233Snate@binkert.org
1368233Snate@binkert.org########################################################################
1378233Snate@binkert.org#
1388233Snate@binkert.org# Set some compiler variables
1398233Snate@binkert.org#
1408233Snate@binkert.org
1418233Snate@binkert.org# Include file paths are rooted in this directory.  SCons will
1428233Snate@binkert.org# automatically expand '.' to refer to both the source directory and
1438233Snate@binkert.org# the corresponding build directory to pick up generated include
1448233Snate@binkert.org# files.
1456143Snate@binkert.orgenv.Append(CPPPATH=Dir('.'))
1466143Snate@binkert.org
1476143Snate@binkert.org# Add a flag defining what THE_ISA should be for all compilation
1486143Snate@binkert.orgenv.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())])
1496143Snate@binkert.org
1506143Snate@binkert.org########################################################################
1516143Snate@binkert.org#
1526143Snate@binkert.org# Walk the tree and execute all SConscripts
1536143Snate@binkert.org#
1548233Snate@binkert.orgsrcdir = env['SRCDIR']
1558233Snate@binkert.orgfor root, dirs, files in os.walk(srcdir, topdown=True):
1568233Snate@binkert.org    if root == srcdir:
1576143Snate@binkert.org        # we don't want to recurse back into this SConscript
1586143Snate@binkert.org        continue
1596143Snate@binkert.org
1606143Snate@binkert.org    if 'SConscript' in files:
1616143Snate@binkert.org        # strip off the srcdir part since scons will try to find the
1626143Snate@binkert.org        # script in the build directory
1635522Snate@binkert.org        base = root[len(srcdir) + 1:]
1646143Snate@binkert.org        SConscript(joinpath(base, 'SConscript'))
1656143Snate@binkert.org
1666143Snate@binkert.orgfor extra in env['EXTRAS'].split(':'):
1676143Snate@binkert.org    extra = os.path.expanduser(extra)
1688233Snate@binkert.org    env.Append(CPPPATH=[Dir(extra)])
1698233Snate@binkert.org    for root, dirs, files in os.walk(extra, topdown=True):
1708233Snate@binkert.org        if 'SConscript' in files:
1716143Snate@binkert.org            subdir = root[len(os.path.dirname(extra))+1:]
1726143Snate@binkert.org            build_dir = joinpath(env['BUILDDIR'], subdir)
1736143Snate@binkert.org            SConscript(joinpath(root, 'SConscript'), build_dir=build_dir)
1746143Snate@binkert.org
1755522Snate@binkert.orgfor opt in env.ExportOptions:
1765522Snate@binkert.org    env.ConfigFile(opt)
1775522Snate@binkert.org
1785522Snate@binkert.org########################################################################
1795604Snate@binkert.org#
1805604Snate@binkert.org# Prevent any SimObjects from being added after this point, they
1816143Snate@binkert.org# should all have been added in the SConscripts above
1826143Snate@binkert.org#
1834762Snate@binkert.orgsim_objects_fixed = True
1844762Snate@binkert.org
1856143Snate@binkert.org########################################################################
1866727Ssteve.reinhardt@amd.com#
1876727Ssteve.reinhardt@amd.com# Manually turn python/generate.py into a python module and import it
1886727Ssteve.reinhardt@amd.com#
1894762Snate@binkert.orggenerate_file = File('python/generate.py')
1906143Snate@binkert.orggenerate_module = imp.new_module('generate')
1916143Snate@binkert.orgsys.modules['generate'] = generate_module
1926143Snate@binkert.orgexec file(generate_file.srcnode().abspath, 'r') in generate_module.__dict__
1936143Snate@binkert.org
1946727Ssteve.reinhardt@amd.com########################################################################
1956143Snate@binkert.org#
1967674Snate@binkert.org# build a generate
1977674Snate@binkert.org#
1985604Snate@binkert.orgfrom generate import Generate
1996143Snate@binkert.orgoptionDict = dict([(opt, env[opt]) for opt in env.ExportOptions])
2006143Snate@binkert.orggenerate = Generate(py_sources, sim_object_modfiles, optionDict)
2016143Snate@binkert.orgm5 = generate.m5
2024762Snate@binkert.org
2036143Snate@binkert.org########################################################################
2044762Snate@binkert.org#
2054762Snate@binkert.org# calculate extra dependencies
2064762Snate@binkert.org#
2076143Snate@binkert.orgmodule_depends = ["m5", "m5.SimObject", "m5.params"]
2086143Snate@binkert.orgmodule_depends = [ File(generate.py_modules[dep]) for dep in module_depends ]
2094762Snate@binkert.orgfile_depends = [ generate_file ]
2108233Snate@binkert.orgdepends = module_depends + file_depends
2118233Snate@binkert.org
2128233Snate@binkert.org########################################################################
2138233Snate@binkert.org#
2146143Snate@binkert.org# Commands for the basic automatically generated python files
2156143Snate@binkert.org#
2164762Snate@binkert.org
2176143Snate@binkert.org# Generate a file with all of the compile options in it
2184762Snate@binkert.orgenv.Command('python/m5/defines.py', Value(optionDict),
2196143Snate@binkert.org            generate.makeDefinesPyFile)
2204762Snate@binkert.orgPySource('m5', 'python/m5/defines.py')
2216143Snate@binkert.org
2228233Snate@binkert.org# Generate a file that wraps the basic top level files
2238233Snate@binkert.orgenv.Command('python/m5/info.py',
2248233Snate@binkert.org            [ '#/AUTHORS', '#/LICENSE', '#/README', '#/RELEASE_NOTES' ],
2256143Snate@binkert.org            generate.makeInfoPyFile)
2266143Snate@binkert.orgPySource('m5', 'python/m5/info.py')
2276143Snate@binkert.org
2286143Snate@binkert.org# Generate an __init__.py file for the objects package
2296143Snate@binkert.orgenv.Command('python/m5/objects/__init__.py',
2306143Snate@binkert.org            [ Value(o) for o in sort_list(sim_object_modfiles) ],
2316143Snate@binkert.org            generate.makeObjectsInitFile)
2326143Snate@binkert.orgPySource('m5.objects', 'python/m5/objects/__init__.py')
2338233Snate@binkert.org
2348233Snate@binkert.org########################################################################
235955SN/A#
2368235Snate@binkert.org# Create all of the SimObject param headers and enum headers
2378235Snate@binkert.org#
2386143Snate@binkert.org
2398235Snate@binkert.org# Generate all of the SimObject param struct header files
2408235Snate@binkert.orgparams_hh_files = []
2418235Snate@binkert.orgfor name,simobj in generate.sim_objects.iteritems():
2428235Snate@binkert.org    extra_deps = [ File(generate.py_modules[simobj.__module__]) ]
2438235Snate@binkert.org
2448235Snate@binkert.org    hh_file = File('params/%s.hh' % name)
2458235Snate@binkert.org    params_hh_files.append(hh_file)
2468235Snate@binkert.org    env.Command(hh_file, Value(name), generate.createSimObjectParam)
2478235Snate@binkert.org    env.Depends(hh_file, depends + extra_deps)
2488235Snate@binkert.org
2498235Snate@binkert.org# Generate any parameter header files needed
2508235Snate@binkert.orgfor name,param in generate.params.iteritems():
2518235Snate@binkert.org    if isinstance(param, m5.params.VectorParamDesc):
2528235Snate@binkert.org        ext = 'vptype'
2538235Snate@binkert.org    else:
2548235Snate@binkert.org        ext = 'ptype'
2558235Snate@binkert.org
2565584Snate@binkert.org    i_file = File('params/%s_%s.i' % (name, ext))
2574382Sbinkertn@umich.edu    env.Command(i_file, Value(name), generate.createSwigParam)
2584202Sbinkertn@umich.edu    env.Depends(i_file, depends)
2594382Sbinkertn@umich.edu
2604382Sbinkertn@umich.edu# Generate all enum header files
2614382Sbinkertn@umich.edufor name,enum in generate.enums.iteritems():
2625584Snate@binkert.org    extra_deps = [ File(generate.py_modules[enum.__module__]) ]
2634382Sbinkertn@umich.edu
2644382Sbinkertn@umich.edu    cc_file = File('enums/%s.cc' % name)
2654382Sbinkertn@umich.edu    env.Command(cc_file, Value(name), generate.createEnumStrings)
2668232Snate@binkert.org    env.Depends(cc_file, depends + extra_deps)
2675192Ssaidi@eecs.umich.edu    Source(cc_file)
2688232Snate@binkert.org
2698232Snate@binkert.org    hh_file = File('enums/%s.hh' % name)
2708232Snate@binkert.org    env.Command(hh_file, Value(name), generate.createEnumParam)
2715192Ssaidi@eecs.umich.edu    env.Depends(hh_file, depends + extra_deps)
2728232Snate@binkert.org
2735192Ssaidi@eecs.umich.edu# Build the big monolithic swigged params module (wraps all SimObject
2745799Snate@binkert.org# param structs and enum structs)
2758232Snate@binkert.orgparams_file = File('params/params.i')
2765192Ssaidi@eecs.umich.edunames = sort_list(generate.sim_objects.keys())
2775192Ssaidi@eecs.umich.eduenv.Command(params_file, [ Value(v) for v in names ],
2785192Ssaidi@eecs.umich.edu            generate.buildParams)
2798232Snate@binkert.orgenv.Depends(params_file, params_hh_files + depends)
2805192Ssaidi@eecs.umich.eduSwigSource('m5.objects', params_file)
2818232Snate@binkert.org
2825192Ssaidi@eecs.umich.edu# Build all swig modules
2835192Ssaidi@eecs.umich.eduswig_modules = []
2845192Ssaidi@eecs.umich.edufor source,package in swig_sources:
2855192Ssaidi@eecs.umich.edu    filename = str(source)
2864382Sbinkertn@umich.edu    assert filename.endswith('.i')
2874382Sbinkertn@umich.edu
2884382Sbinkertn@umich.edu    base = '.'.join(filename.split('.')[:-1])
2892667Sstever@eecs.umich.edu    module = basename(base)
2902667Sstever@eecs.umich.edu    cc_file = base + '_wrap.cc'
2912667Sstever@eecs.umich.edu    py_file = base + '.py'
2922667Sstever@eecs.umich.edu
2932667Sstever@eecs.umich.edu    env.Command([cc_file, py_file], source,
2942667Sstever@eecs.umich.edu                '$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
2955742Snate@binkert.org                '-o ${TARGETS[0]} $SOURCES')
2965742Snate@binkert.org    env.Depends(py_file, source)
2975742Snate@binkert.org    env.Depends(cc_file, source)
2985793Snate@binkert.org
2998334Snate@binkert.org    swig_modules.append(Value(module))
3005793Snate@binkert.org    Source(cc_file)
3015793Snate@binkert.org    PySource(package, py_file)
3025793Snate@binkert.org
3034382Sbinkertn@umich.edu# Generate the main swig init file
3044762Snate@binkert.orgenv.Command('swig/init.cc', swig_modules, generate.makeSwigInit)
3055344Sstever@gmail.comSource('swig/init.cc')
3064382Sbinkertn@umich.edu
3075341Sstever@gmail.com# Build the zip file
3085742Snate@binkert.orgpy_compiled = []
3095742Snate@binkert.orgpy_zip_depends = []
3105742Snate@binkert.orgfor source in py_sources:
3115742Snate@binkert.org    env.Command(source.compiled, source.source, generate.compilePyFile)
3125742Snate@binkert.org    py_compiled.append(source.compiled)
3134762Snate@binkert.org
3145742Snate@binkert.org    # make the zipfile depend on the archive name so that the archive
3155742Snate@binkert.org    # is rebuilt if the name changes
3167722Sgblack@eecs.umich.edu    py_zip_depends.append(Value(source.arcname))
3175742Snate@binkert.org
3185742Snate@binkert.org# Add the zip file target to the environment.
3195742Snate@binkert.orgm5zip = File('m5py.zip')
3205742Snate@binkert.orgenv.Command(m5zip, py_compiled, generate.buildPyZip)
3218242Sbradley.danofsky@amd.comenv.Depends(m5zip, py_zip_depends)
3228242Sbradley.danofsky@amd.com
3238242Sbradley.danofsky@amd.com########################################################################
3248242Sbradley.danofsky@amd.com#
3255341Sstever@gmail.com# Define binaries.  Each different build type (debug, opt, etc.) gets
3265742Snate@binkert.org# a slightly different build environment.
3277722Sgblack@eecs.umich.edu#
3284773Snate@binkert.org
3296108Snate@binkert.org# List of constructed environments to pass back to SConstruct
3301858SN/AenvList = []
3311085SN/A
3326658Snate@binkert.org# This function adds the specified sources to the given build
3336658Snate@binkert.org# environment, and returns a list of all the corresponding SCons
3347673Snate@binkert.org# Object nodes (including an extra one for date.cc).  We explicitly
3356658Snate@binkert.org# add the Object nodes so we can set up special dependencies for
3366658Snate@binkert.org# date.cc.
3376658Snate@binkert.orgdef make_objs(sources, env):
3386658Snate@binkert.org    objs = [env.Object(s) for s in sources]
3396658Snate@binkert.org    # make date.cc depend on all other objects so it always gets
3406658Snate@binkert.org    # recompiled whenever anything else does
3416658Snate@binkert.org    date_obj = env.Object('base/date.cc')
3427673Snate@binkert.org    env.Depends(date_obj, objs)
3437673Snate@binkert.org    objs.append(date_obj)
3447673Snate@binkert.org    return objs
3457673Snate@binkert.org
3467673Snate@binkert.org# Function to create a new build environment as clone of current
3477673Snate@binkert.org# environment 'env' with modified object suffix and optional stripped
3487673Snate@binkert.org# binary.  Additional keyword arguments are appended to corresponding
3496658Snate@binkert.org# build environment vars.
3507673Snate@binkert.orgdef makeEnv(label, objsfx, strip = False, **kwargs):
3517673Snate@binkert.org    newEnv = env.Copy(OBJSUFFIX=objsfx)
3527673Snate@binkert.org    newEnv.Label = label
3537673Snate@binkert.org    newEnv.Append(**kwargs)
3547673Snate@binkert.org    exe = 'm5.' + label  # final executable
3557673Snate@binkert.org    bin = exe + '.bin'   # executable w/o appended Python zip archive
3567673Snate@binkert.org    newEnv.Program(bin, make_objs(cc_sources, newEnv))
3577673Snate@binkert.org    if strip:
3587673Snate@binkert.org        stripped_bin = bin + '.stripped'
3597673Snate@binkert.org        if sys.platform == 'sunos5':
3606658Snate@binkert.org            cmd = 'cp $SOURCE $TARGET; strip $TARGET'
3617756SAli.Saidi@ARM.com        else:
3627816Ssteve.reinhardt@amd.com            cmd = 'strip $SOURCE -o $TARGET'
3636658Snate@binkert.org        newEnv.Command(stripped_bin, bin, cmd)
3644382Sbinkertn@umich.edu        bin = stripped_bin
3654382Sbinkertn@umich.edu    targets = newEnv.Concat(exe, [bin, 'm5py.zip'])
3664762Snate@binkert.org    newEnv.M5Binary = targets[0]
3674762Snate@binkert.org    envList.append(newEnv)
3684762Snate@binkert.org
3696654Snate@binkert.org# Debug binary
3706654Snate@binkert.orgccflags = {}
3715517Snate@binkert.orgif env['GCC']:
3725517Snate@binkert.org    if sys.platform == 'sunos5':
3735517Snate@binkert.org        ccflags['debug'] = '-gstabs+'
3745517Snate@binkert.org    else:
3755517Snate@binkert.org        ccflags['debug'] = '-ggdb3'
3765517Snate@binkert.org    ccflags['opt'] = '-g -O3'
3775517Snate@binkert.org    ccflags['fast'] = '-O3'
3785517Snate@binkert.org    ccflags['prof'] = '-O3 -g -pg'
3795517Snate@binkert.orgelif env['SUNCC']:
3805517Snate@binkert.org    ccflags['debug'] = '-g0'
3815517Snate@binkert.org    ccflags['opt'] = '-g -O'
3825517Snate@binkert.org    ccflags['fast'] = '-fast'
3835517Snate@binkert.org    ccflags['prof'] = '-fast -g -pg'
3845517Snate@binkert.orgelif env['ICC']:
3855517Snate@binkert.org    ccflags['debug'] = '-g -O0'
3865517Snate@binkert.org    ccflags['opt'] = '-g -O'
3875517Snate@binkert.org    ccflags['fast'] = '-fast'
3886654Snate@binkert.org    ccflags['prof'] = '-fast -g -pg'
3895517Snate@binkert.orgelse:
3905517Snate@binkert.org    print 'Unknown compiler, please fix compiler options'
3915517Snate@binkert.org    Exit(1)
3925517Snate@binkert.org
3935517Snate@binkert.orgmakeEnv('debug', '.do',
3945517Snate@binkert.org        CCFLAGS = Split(ccflags['debug']),
3955517Snate@binkert.org        CPPDEFINES = ['DEBUG', 'TRACING_ON=1'])
3965517Snate@binkert.org
3976143Snate@binkert.org# Optimized binary
3986654Snate@binkert.orgmakeEnv('opt', '.o',
3995517Snate@binkert.org        CCFLAGS = Split(ccflags['opt']),
4005517Snate@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',
4095517Snate@binkert.org        CCFLAGS = Split(ccflags['prof']),
4105517Snate@binkert.org        CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
4115517Snate@binkert.org        LINKFLAGS = '-pg')
4125517Snate@binkert.org
4136654Snate@binkert.orgReturn('envList')
4146654Snate@binkert.org