SConscript revision 2178
12SN/A# -*- mode:python -*-
21762SN/A
32SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan
42SN/A# All rights reserved.
52SN/A#
62SN/A# Redistribution and use in source and binary forms, with or without
72SN/A# modification, are permitted provided that the following conditions are
82SN/A# met: redistributions of source code must retain the above copyright
92SN/A# notice, this list of conditions and the following disclaimer;
102SN/A# redistributions in binary form must reproduce the above copyright
112SN/A# notice, this list of conditions and the following disclaimer in the
122SN/A# documentation and/or other materials provided with the distribution;
132SN/A# neither the name of the copyright holders nor the names of its
142SN/A# contributors may be used to endorse or promote products derived from
152SN/A# this software without specific prior written permission.
162SN/A#
172SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
182SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
192SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
202SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
212SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
222SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
232SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
242SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
252SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
262SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
272665Ssaidi@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282665Ssaidi@eecs.umich.edu
292665Ssaidi@eecs.umich.eduimport os
302SN/Aimport sys
312SN/Afrom os.path import isdir
32360SN/A
33360SN/A# This file defines how to build a particular configuration of M5
342SN/A# based on variable settings in the 'env' build environment.
354117Sgblack@eecs.umich.edu
36180SN/A# Import build environment variable from SConstruct.
372SN/AImport('env')
386329Sgblack@eecs.umich.edu
392378SN/A###################################################
406214Snate@binkert.org#
416658Snate@binkert.org# Define needed sources.
428852Sandreas.hansson@arm.com#
4356SN/A###################################################
445958Sgblack@eecs.umich.edu
452SN/A# Base sources used by all configurations.
465154Sgblack@eecs.umich.edu
478737Skoansin.tan@gmail.combase_sources = Split('''
488737Skoansin.tan@gmail.com	base/circlebuf.cc
495154Sgblack@eecs.umich.edu	base/copyright.cc
505154Sgblack@eecs.umich.edu	base/cprintf.cc
512680Sktlim@umich.edu        base/embedfile.cc
522378SN/A	base/fast_alloc.cc
535758Shsul@eecs.umich.edu	base/fifo_buffer.cc
545771Shsul@eecs.umich.edu	base/hostinfo.cc
555758Shsul@eecs.umich.edu	base/hybrid_pred.cc
565758Shsul@eecs.umich.edu	base/inifile.cc
575771Shsul@eecs.umich.edu	base/intmath.cc
585758Shsul@eecs.umich.edu	base/match.cc
595771Shsul@eecs.umich.edu	base/misc.cc
605758Shsul@eecs.umich.edu	base/output.cc
615758Shsul@eecs.umich.edu	base/pollevent.cc
625771Shsul@eecs.umich.edu	base/range.cc
635758Shsul@eecs.umich.edu	base/random.cc
645758Shsul@eecs.umich.edu	base/sat_counter.cc
652SN/A	base/socket.cc
662SN/A	base/statistics.cc
672SN/A	base/str.cc
682SN/A	base/time.cc
692378SN/A	base/trace.cc
702378SN/A	base/traceflags.cc
712378SN/A	base/userinfo.cc
722378SN/A	base/compression/lzss_compression.cc
732680Sktlim@umich.edu	base/loader/aout_object.cc
745713Shsul@eecs.umich.edu	base/loader/ecoff_object.cc
75180SN/A	base/loader/elf_object.cc
76180SN/A	base/loader/object_file.cc
775713Shsul@eecs.umich.edu	base/loader/symtab.cc
782SN/A	base/stats/events.cc
792SN/A	base/stats/statdb.cc
802SN/A	base/stats/visit.cc
812SN/A	base/stats/text.cc
822SN/A
832680Sktlim@umich.edu	cpu/base.cc
842SN/A        cpu/base_dyn_inst.cc
852680Sktlim@umich.edu	cpu/exec_context.cc
862SN/A	cpu/exetrace.cc
875543Ssaidi@eecs.umich.edu	cpu/pc_event.cc
882SN/A	cpu/static_inst.cc
892SN/A        cpu/sampler/sampler.cc
902SN/A        cpu/trace/reader/mem_trace_reader.cc
912SN/A        cpu/trace/reader/ibm_reader.cc
922SN/A        cpu/trace/reader/itx_reader.cc
935543Ssaidi@eecs.umich.edu        cpu/trace/reader/m5_reader.cc
942SN/A        cpu/trace/opt_cpu.cc
955543Ssaidi@eecs.umich.edu        cpu/trace/trace_cpu.cc
965543Ssaidi@eecs.umich.edu
975543Ssaidi@eecs.umich.edu	encumbered/mem/functional/main.cc
982SN/A
995154Sgblack@eecs.umich.edu	mem/base_hier.cc
1005154Sgblack@eecs.umich.edu	mem/base_mem.cc
1015154Sgblack@eecs.umich.edu	mem/hier_params.cc
1022SN/A	mem/mem_cmd.cc
1032SN/A	mem/mem_debug.cc
1042SN/A	mem/mem_req.cc
105360SN/A	mem/memory_interface.cc
1061408SN/A	mem/bus/base_interface.cc
1071408SN/A	mem/bus/bus.cc
108360SN/A	mem/bus/bus_bridge.cc
1091514SN/A	mem/bus/bus_bridge_master.cc
1101514SN/A	mem/bus/bus_bridge_slave.cc
1111514SN/A	mem/bus/bus_interface.cc
1121514SN/A	mem/bus/dma_bus_interface.cc
1135543Ssaidi@eecs.umich.edu	mem/bus/dma_interface.cc
1142SN/A	mem/bus/master_interface.cc
1155999Snate@binkert.org	mem/bus/slave_interface.cc
1162SN/A	mem/cache/base_cache.cc
1172SN/A	mem/cache/cache.cc
1182SN/A	mem/cache/cache_builder.cc
1192SN/A	mem/cache/coherence/coherence_protocol.cc
1208325Ssteve.reinhardt@amd.com	mem/cache/coherence/uni_coherence.cc
1212SN/A	mem/cache/miss/blocking_buffer.cc
1227532Ssteve.reinhardt@amd.com	mem/cache/miss/miss_queue.cc
1232SN/A	mem/cache/miss/mshr.cc
1242378SN/A	mem/cache/miss/mshr_queue.cc
1252SN/A        mem/cache/prefetch/base_prefetcher.cc
1264997Sgblack@eecs.umich.edu        mem/cache/prefetch/prefetcher.cc
1274997Sgblack@eecs.umich.edu        mem/cache/prefetch/tagged_prefetcher.cc
1284997Sgblack@eecs.umich.edu	mem/cache/tags/base_tags.cc
1294997Sgblack@eecs.umich.edu	mem/cache/tags/cache_tags.cc	
1308852Sandreas.hansson@arm.com	mem/cache/tags/fa_lru.cc
1318852Sandreas.hansson@arm.com	mem/cache/tags/iic.cc
1325282Srstrong@cs.ucsd.edu	mem/cache/tags/lru.cc
1335282Srstrong@cs.ucsd.edu	mem/cache/tags/repl/gen.cc
1345282Srstrong@cs.ucsd.edu	mem/cache/tags/repl/repl.cc
1358325Ssteve.reinhardt@amd.com	mem/cache/tags/split.cc
1368325Ssteve.reinhardt@amd.com	mem/cache/tags/split_lru.cc
1378325Ssteve.reinhardt@amd.com	mem/cache/tags/split_lifo.cc
1388325Ssteve.reinhardt@amd.com	mem/functional/functional.cc
1398325Ssteve.reinhardt@amd.com	mem/timing/base_memory.cc
1408325Ssteve.reinhardt@amd.com	mem/timing/memory_builder.cc
1418325Ssteve.reinhardt@amd.com	mem/timing/simple_mem_bank.cc
1425282Srstrong@cs.ucsd.edu        mem/trace/itx_writer.cc
1438325Ssteve.reinhardt@amd.com	mem/trace/mem_trace_writer.cc
1448325Ssteve.reinhardt@amd.com	mem/trace/m5_writer.cc
1458325Ssteve.reinhardt@amd.com
1468325Ssteve.reinhardt@amd.com        python/pyconfig.cc
1475282Srstrong@cs.ucsd.edu        python/embedded_py.cc
1485282Srstrong@cs.ucsd.edu
1495282Srstrong@cs.ucsd.edu	sim/builder.cc
1505282Srstrong@cs.ucsd.edu	sim/configfile.cc
1515282Srstrong@cs.ucsd.edu	sim/debug.cc
1528852Sandreas.hansson@arm.com	sim/eventq.cc
1538852Sandreas.hansson@arm.com	sim/faults.cc
1548852Sandreas.hansson@arm.com	sim/main.cc
1558852Sandreas.hansson@arm.com	sim/param.cc
1562SN/A	sim/profile.cc
1572SN/A	sim/root.cc
1585282Srstrong@cs.ucsd.edu	sim/serialize.cc
1595282Srstrong@cs.ucsd.edu	sim/sim_events.cc
1605282Srstrong@cs.ucsd.edu	sim/sim_exit.cc
1612SN/A	sim/sim_object.cc
1622SN/A	sim/startup.cc
1632SN/A	sim/stat_context.cc
1642SN/A	sim/stat_control.cc
1652SN/A	sim/trace_context.cc
1662SN/A        ''')
1672SN/A
1682SN/A# Old FullCPU sources
1692SN/Afull_cpu_sources = Split('''
1705713Shsul@eecs.umich.edu	encumbered/cpu/full/bpred.cc
1715713Shsul@eecs.umich.edu	encumbered/cpu/full/commit.cc
1725713Shsul@eecs.umich.edu	encumbered/cpu/full/cpu.cc
1735713Shsul@eecs.umich.edu	encumbered/cpu/full/create_vector.cc
1745713Shsul@eecs.umich.edu	encumbered/cpu/full/cv_spec_state.cc
1755713Shsul@eecs.umich.edu	encumbered/cpu/full/dd_queue.cc
176180SN/A	encumbered/cpu/full/dep_link.cc
1775713Shsul@eecs.umich.edu	encumbered/cpu/full/dispatch.cc
1788325Ssteve.reinhardt@amd.com	encumbered/cpu/full/dyn_inst.cc
1792SN/A	encumbered/cpu/full/execute.cc
1802SN/A	encumbered/cpu/full/fetch.cc
1812SN/A	encumbered/cpu/full/floss_reasons.cc
1822SN/A	encumbered/cpu/full/fu_pool.cc
1832SN/A	encumbered/cpu/full/inst_fifo.cc
1848325Ssteve.reinhardt@amd.com	encumbered/cpu/full/instpipe.cc
1858325Ssteve.reinhardt@amd.com	encumbered/cpu/full/issue.cc
1861970SN/A	encumbered/cpu/full/ls_queue.cc
1871970SN/A	encumbered/cpu/full/machine_queue.cc
1881970SN/A        encumbered/cpu/full/pipetrace.cc
1892SN/A        encumbered/cpu/full/readyq.cc
1902SN/A        encumbered/cpu/full/reg_info.cc
1912SN/A        encumbered/cpu/full/rob_station.cc
1922SN/A        encumbered/cpu/full/spec_memory.cc
1935282Srstrong@cs.ucsd.edu        encumbered/cpu/full/spec_state.cc
1948325Ssteve.reinhardt@amd.com        encumbered/cpu/full/storebuffer.cc
1955282Srstrong@cs.ucsd.edu        encumbered/cpu/full/writeback.cc
1965282Srstrong@cs.ucsd.edu        encumbered/cpu/full/iq/iq_station.cc
1975282Srstrong@cs.ucsd.edu        encumbered/cpu/full/iq/iqueue.cc
1985282Srstrong@cs.ucsd.edu        encumbered/cpu/full/iq/segmented/chain_info.cc
1995282Srstrong@cs.ucsd.edu        encumbered/cpu/full/iq/segmented/chain_wire.cc
2005282Srstrong@cs.ucsd.edu        encumbered/cpu/full/iq/segmented/iq_seg.cc
2015282Srstrong@cs.ucsd.edu        encumbered/cpu/full/iq/segmented/iq_segmented.cc
2025282Srstrong@cs.ucsd.edu        encumbered/cpu/full/iq/segmented/seg_chain.cc
2035282Srstrong@cs.ucsd.edu        encumbered/cpu/full/iq/seznec/iq_seznec.cc
2045282Srstrong@cs.ucsd.edu        encumbered/cpu/full/iq/standard/iq_standard.cc
2052680Sktlim@umich.edu        ''')
2063311Ssaidi@eecs.umich.edu
2078601Ssteve.reinhardt@amd.com# MySql sources
2088601Ssteve.reinhardt@amd.commysql_sources = Split('''
2098539Sgblack@eecs.umich.edu	base/mysql.cc
2108539Sgblack@eecs.umich.edu	base/stats/mysql.cc
2118539Sgblack@eecs.umich.edu        ''')
2124434Ssaidi@eecs.umich.edu
2133311Ssaidi@eecs.umich.edu# Full-system sources
2143311Ssaidi@eecs.umich.edufull_system_sources = Split('''
2152SN/A	base/crc.cc
2162SN/A	base/inet.cc
2172SN/A	base/remote_gdb.cc
2182SN/A
2192SN/A	cpu/intr_control.cc
220360SN/A        cpu/profile.cc
2212SN/A
2222SN/A	dev/alpha_console.cc
223360SN/A	dev/baddev.cc
2242378SN/A        dev/simconsole.cc
2252378SN/A	dev/disk_image.cc
2262378SN/A	dev/etherbus.cc
2273669Sbinkertn@umich.edu	dev/etherdump.cc
2282378SN/A	dev/etherint.cc
2298325Ssteve.reinhardt@amd.com	dev/etherlink.cc
2302SN/A	dev/etherpkt.cc
2313114Sgblack@eecs.umich.edu	dev/ethertap.cc
2323114Sgblack@eecs.umich.edu	dev/ide_ctrl.cc
2333114Sgblack@eecs.umich.edu	dev/ide_disk.cc
2343114Sgblack@eecs.umich.edu	dev/io_device.cc
2353114Sgblack@eecs.umich.edu	dev/ns_gige.cc
2363114Sgblack@eecs.umich.edu	dev/pciconfigall.cc
2373114Sgblack@eecs.umich.edu	dev/pcidev.cc
2383114Sgblack@eecs.umich.edu	dev/pcifake.cc
2393114Sgblack@eecs.umich.edu	dev/pktfifo.cc
2403114Sgblack@eecs.umich.edu	dev/platform.cc
241360SN/A	dev/sinic.cc
2423114Sgblack@eecs.umich.edu	dev/simple_disk.cc
2434793Sgblack@eecs.umich.edu	dev/tsunami.cc
2444793Sgblack@eecs.umich.edu	dev/tsunami_cchip.cc
2454793Sgblack@eecs.umich.edu	dev/isa_fake.cc
2464793Sgblack@eecs.umich.edu	dev/tsunami_io.cc
2474793Sgblack@eecs.umich.edu	dev/tsunami_pchip.cc
2484793Sgblack@eecs.umich.edu	dev/uart.cc
2494793Sgblack@eecs.umich.edu	dev/uart8250.cc
2504793Sgblack@eecs.umich.edu
2514793Sgblack@eecs.umich.edu	kern/kernel_binning.cc
2524793Sgblack@eecs.umich.edu	kern/kernel_stats.cc
2534793Sgblack@eecs.umich.edu	kern/system_events.cc
2544793Sgblack@eecs.umich.edu	kern/freebsd/freebsd_system.cc
2554793Sgblack@eecs.umich.edu	kern/linux/linux_syscalls.cc
2564793Sgblack@eecs.umich.edu	kern/linux/linux_system.cc
2574793Sgblack@eecs.umich.edu	kern/linux/printk.cc
2584793Sgblack@eecs.umich.edu	kern/tru64/dump_mbuf.cc
2594793Sgblack@eecs.umich.edu	kern/tru64/printf.cc
2604793Sgblack@eecs.umich.edu	kern/tru64/tru64_events.cc
2614793Sgblack@eecs.umich.edu	kern/tru64/tru64_syscalls.cc
2624793Sgblack@eecs.umich.edu	kern/tru64/tru64_system.cc
2634793Sgblack@eecs.umich.edu
2644793Sgblack@eecs.umich.edu	mem/functional/memory_control.cc
2656399Sgblack@eecs.umich.edu	mem/functional/physical.cc
2666399Sgblack@eecs.umich.edu
2676399Sgblack@eecs.umich.edu	sim/system.cc
2686399Sgblack@eecs.umich.edu	sim/pseudo_inst.cc
2694793Sgblack@eecs.umich.edu        ''')
2704793Sgblack@eecs.umich.edu
2714793Sgblack@eecs.umich.edu# turbolaser encumbered sources
2724793Sgblack@eecs.umich.eduturbolaser_sources = Split('''
2733114Sgblack@eecs.umich.edu	encumbered/dev/dma.cc
2743114Sgblack@eecs.umich.edu	encumbered/dev/etherdev.cc
2753114Sgblack@eecs.umich.edu	encumbered/dev/scsi.cc
2763114Sgblack@eecs.umich.edu	encumbered/dev/scsi_ctrl.cc
2773114Sgblack@eecs.umich.edu	encumbered/dev/scsi_disk.cc
2783114Sgblack@eecs.umich.edu	encumbered/dev/scsi_none.cc
2793114Sgblack@eecs.umich.edu	encumbered/dev/tlaser_clock.cc
2803669Sbinkertn@umich.edu	encumbered/dev/tlaser_ipi.cc
2813669Sbinkertn@umich.edu	encumbered/dev/tlaser_mbox.cc
2823669Sbinkertn@umich.edu	encumbered/dev/tlaser_mc146818.cc
2833669Sbinkertn@umich.edu	encumbered/dev/tlaser_node.cc
2843669Sbinkertn@umich.edu	encumbered/dev/tlaser_pcia.cc
2853669Sbinkertn@umich.edu	encumbered/dev/tlaser_pcidev.cc
2863669Sbinkertn@umich.edu	encumbered/dev/tlaser_serial.cc
2873669Sbinkertn@umich.edu	encumbered/dev/turbolaser.cc
2883669Sbinkertn@umich.edu	encumbered/dev/uart8530.cc
2893669Sbinkertn@umich.edu        ''')
2903669Sbinkertn@umich.edu
2913669Sbinkertn@umich.edu# Syscall emulation (non-full-system) sources
2923669Sbinkertn@umich.edusyscall_emulation_sources = Split('''
2933669Sbinkertn@umich.edu	cpu/memtest/memtest.cc
2945513SMichael.Adler@intel.com	encumbered/eio/eio.cc
2955513SMichael.Adler@intel.com	encumbered/eio/exolex.cc
2962680Sktlim@umich.edu	encumbered/eio/libexo.cc
2976701Sgblack@eecs.umich.edu        kern/linux/linux.cc
2986701Sgblack@eecs.umich.edu        kern/tru64/tru64.cc
2996701Sgblack@eecs.umich.edu	sim/process.cc
3005958Sgblack@eecs.umich.edu	sim/syscall_emul.cc
3015958Sgblack@eecs.umich.edu        ''')
3025958Sgblack@eecs.umich.edu
3035958Sgblack@eecs.umich.edu# The following stuff (targetarch code and global define of THE_ISA)
3042093SN/A# are legacy things that assume we're only compiling one ISA at a
3058325Ssteve.reinhardt@amd.com# time.  These will have to go away if we want to build a binary that
3062715Sstever@eecs.umich.edu# supports multiple ISAs.
3072715Sstever@eecs.umich.edu
3082715Sstever@eecs.umich.edutargetarch_files = Split('''
3092715Sstever@eecs.umich.edu        alpha_linux_process.hh
3108325Ssteve.reinhardt@amd.com        alpha_memory.hh
3112SN/A        alpha_tru64_process.hh
3122SN/A        aout_machdep.h
313360SN/A        arguments.hh
314360SN/A        ecoff_machdep.h
315        ev5.hh
316        faults.hh
317        stacktrace.hh
318        vtophys.hh
319        ''')
320
321# Set up bridging headers to the architecture specific versions
322for f in targetarch_files:
323    env.Command('targetarch/' + f, 'arch/%s/%s' % (env['TARGET_ISA'], f),
324                '''echo '#include "arch/%s/%s"' > $TARGET''' % (env['TARGET_ISA'], f))
325
326# Add a flag defining what THE_ISA should be for all compilation
327env.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())])
328
329arch_sources = SConscript('arch/SConscript',
330                          exports = 'env', duplicate = False)
331
332cpu_sources = SConscript('cpu/SConscript',
333                         exports = 'env', duplicate = False)
334
335# This is outside of cpu/SConscript since the source directory isn't
336# underneath 'cpu'.
337if 'FullCPU' in env['CPU_MODELS']:
338    cpu_sources += full_cpu_sources
339
340# Set up complete list of sources based on configuration.
341sources = base_sources + arch_sources + cpu_sources
342
343if env['FULL_SYSTEM']:
344    sources += full_system_sources
345    if env['ALPHA_TLASER']:
346        sources += turbolaser_sources
347else:
348    sources += syscall_emulation_sources
349
350if env['USE_MYSQL']:
351    sources += mysql_sources
352
353for opt in env.ExportOptions:
354    env.ConfigFile(opt)
355
356###################################################
357#
358# Special build rules.
359#
360###################################################
361
362# base/traceflags.{cc,hh} are generated from base/traceflags.py.
363# $TARGET.base will expand to "<build-dir>/base/traceflags".
364env.Command(Split('base/traceflags.hh base/traceflags.cc'),
365            'base/traceflags.py',
366            'python $SOURCE $TARGET.base')
367
368# libelf build is described in its own SConscript file.
369# SConscript-local is the per-config build, which just copies some
370# header files into a place where they can be found.
371SConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
372SConscript('python/SConscript', exports = ['env'], duplicate=0)
373
374# This function adds the specified sources to the given build
375# environment, and returns a list of all the corresponding SCons
376# Object nodes (including an extra one for date.cc).  We explicitly
377# add the Object nodes so we can set up special dependencies for
378# date.cc.
379def make_objs(sources, env):
380    objs = [env.Object(s) for s in sources]
381    # make date.cc depend on all other objects so it always gets
382    # recompiled whenever anything else does
383    date_obj = env.Object('base/date.cc')
384    env.Depends(date_obj, objs)
385    objs.append(date_obj)
386    return objs
387
388###################################################
389#
390# Define binaries.  Each different build type (debug, opt, etc.) gets
391# a slightly different build environment.
392#
393###################################################
394
395# Include file paths are rooted in this directory.  SCons will
396# automatically expand '.' to refer to both the source directory and
397# the corresponding build directory to pick up generated include
398# files.
399env.Append(CPPPATH='.')
400
401# Debug binary
402debugEnv = env.Copy(OBJSUFFIX='.do')
403debugEnv.Label = 'debug'
404debugEnv.Append(CCFLAGS=Split('-g -gstabs+ -O0'))
405debugEnv.Append(CPPDEFINES='DEBUG')
406tlist = debugEnv.Program(target = 'm5.debug',
407                         source = make_objs(sources, debugEnv))
408debugEnv.M5Binary = tlist[0]
409
410# Optimized binary
411optEnv = env.Copy()
412optEnv.Label = 'opt'
413optEnv.Append(CCFLAGS=Split('-g -O5'))
414tlist = optEnv.Program(target = 'm5.opt',
415                       source = make_objs(sources, optEnv))
416optEnv.M5Binary = tlist[0]
417
418# "Fast" binary
419fastEnv = env.Copy(OBJSUFFIX='.fo')
420fastEnv.Label = 'fast'
421fastEnv.Append(CCFLAGS=Split('-O5'))
422fastEnv.Append(CPPDEFINES='NDEBUG')
423fastEnv.Program(target = 'm5.fast.unstripped',
424                source = make_objs(sources, fastEnv))
425tlist = fastEnv.Command(target = 'm5.fast',
426                        source = 'm5.fast.unstripped',
427                        action = 'strip $SOURCE -o $TARGET')
428fastEnv.M5Binary = tlist[0]
429
430# Profiled binary
431profEnv = env.Copy(OBJSUFFIX='.po')
432profEnv.Label = 'prof'
433profEnv.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg')
434tlist = profEnv.Program(target = 'm5.prof',
435                        source = make_objs(sources, profEnv))
436profEnv.M5Binary = tlist[0]
437
438envList = [debugEnv, optEnv, fastEnv, profEnv]
439
440Return('envList')
441