SConscript revision 2395
12929Sktlim@umich.edu# -*- mode:python -*-
22929Sktlim@umich.edu
32932Sktlim@umich.edu# Copyright (c) 2004-2005 The Regents of The University of Michigan
42929Sktlim@umich.edu# All rights reserved.
52929Sktlim@umich.edu#
62929Sktlim@umich.edu# Redistribution and use in source and binary forms, with or without
72929Sktlim@umich.edu# modification, are permitted provided that the following conditions are
82929Sktlim@umich.edu# met: redistributions of source code must retain the above copyright
92929Sktlim@umich.edu# notice, this list of conditions and the following disclaimer;
102929Sktlim@umich.edu# redistributions in binary form must reproduce the above copyright
112929Sktlim@umich.edu# notice, this list of conditions and the following disclaimer in the
122929Sktlim@umich.edu# documentation and/or other materials provided with the distribution;
132929Sktlim@umich.edu# neither the name of the copyright holders nor the names of its
142929Sktlim@umich.edu# contributors may be used to endorse or promote products derived from
152929Sktlim@umich.edu# this software without specific prior written permission.
162929Sktlim@umich.edu#
172929Sktlim@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
182929Sktlim@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
192929Sktlim@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
202929Sktlim@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
212929Sktlim@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
222929Sktlim@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
232929Sktlim@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
242929Sktlim@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
252929Sktlim@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
262929Sktlim@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
272929Sktlim@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282932Sktlim@umich.edu
292932Sktlim@umich.eduimport os
302932Sktlim@umich.eduimport sys
312929Sktlim@umich.edufrom os.path import isdir
326007Ssteve.reinhardt@amd.com
332929Sktlim@umich.edu# This file defines how to build a particular configuration of M5
342929Sktlim@umich.edu# based on variable settings in the 'env' build environment.
352929Sktlim@umich.edu
362929Sktlim@umich.edu# Import build environment variable from SConstruct.
372929Sktlim@umich.eduImport('env')
382929Sktlim@umich.edu
392929Sktlim@umich.edu###################################################
402929Sktlim@umich.edu#
412929Sktlim@umich.edu# Define needed sources.
422929Sktlim@umich.edu#
432929Sktlim@umich.edu###################################################
442929Sktlim@umich.edu
452929Sktlim@umich.edu# Base sources used by all configurations.
462929Sktlim@umich.edubase_sources = Split('''
476007Ssteve.reinhardt@amd.com	arch/alpha/decoder.cc
486007Ssteve.reinhardt@amd.com        arch/alpha/alpha_o3_exec.cc
496007Ssteve.reinhardt@amd.com	arch/alpha/fast_cpu_exec.cc
506007Ssteve.reinhardt@amd.com	arch/alpha/simple_cpu_exec.cc
516007Ssteve.reinhardt@amd.com	arch/alpha/faults.cc
526007Ssteve.reinhardt@amd.com	arch/alpha/isa_traits.cc
536007Ssteve.reinhardt@amd.com
546007Ssteve.reinhardt@amd.com	base/circlebuf.cc
556007Ssteve.reinhardt@amd.com	base/copyright.cc
566007Ssteve.reinhardt@amd.com	base/cprintf.cc
576007Ssteve.reinhardt@amd.com        base/embedfile.cc
586007Ssteve.reinhardt@amd.com	base/fast_alloc.cc
596007Ssteve.reinhardt@amd.com	base/fifo_buffer.cc
606007Ssteve.reinhardt@amd.com	base/hostinfo.cc
616007Ssteve.reinhardt@amd.com	base/hybrid_pred.cc
626007Ssteve.reinhardt@amd.com	base/inifile.cc
636007Ssteve.reinhardt@amd.com	base/intmath.cc
646007Ssteve.reinhardt@amd.com	base/match.cc
656007Ssteve.reinhardt@amd.com	base/misc.cc
666007Ssteve.reinhardt@amd.com	base/output.cc
676007Ssteve.reinhardt@amd.com	base/pollevent.cc
686007Ssteve.reinhardt@amd.com	base/range.cc
696007Ssteve.reinhardt@amd.com	base/random.cc
706007Ssteve.reinhardt@amd.com	base/sat_counter.cc
716007Ssteve.reinhardt@amd.com	base/socket.cc
726007Ssteve.reinhardt@amd.com	base/statistics.cc
736007Ssteve.reinhardt@amd.com	base/str.cc
746007Ssteve.reinhardt@amd.com	base/time.cc
756007Ssteve.reinhardt@amd.com	base/trace.cc
762929Sktlim@umich.edu	base/traceflags.cc
772929Sktlim@umich.edu	base/userinfo.cc
782929Sktlim@umich.edu	base/compression/lzss_compression.cc
796007Ssteve.reinhardt@amd.com	base/loader/aout_object.cc
806007Ssteve.reinhardt@amd.com	base/loader/ecoff_object.cc
816007Ssteve.reinhardt@amd.com	base/loader/elf_object.cc
826007Ssteve.reinhardt@amd.com	base/loader/object_file.cc
836007Ssteve.reinhardt@amd.com	base/loader/symtab.cc
846007Ssteve.reinhardt@amd.com	base/stats/events.cc
852929Sktlim@umich.edu	base/stats/statdb.cc
862929Sktlim@umich.edu	base/stats/visit.cc
872929Sktlim@umich.edu	base/stats/text.cc
882929Sktlim@umich.edu
892929Sktlim@umich.edu	cpu/base.cc
906011Ssteve.reinhardt@amd.com        cpu/base_dyn_inst.cc
916007Ssteve.reinhardt@amd.com	cpu/exec_context.cc
926007Ssteve.reinhardt@amd.com	cpu/exetrace.cc
936007Ssteve.reinhardt@amd.com	cpu/pc_event.cc
946007Ssteve.reinhardt@amd.com	cpu/static_inst.cc
956007Ssteve.reinhardt@amd.com        cpu/o3/2bit_local_pred.cc
966007Ssteve.reinhardt@amd.com        cpu/o3/alpha_dyn_inst.cc
976007Ssteve.reinhardt@amd.com        cpu/o3/alpha_cpu.cc
986007Ssteve.reinhardt@amd.com        cpu/o3/alpha_cpu_builder.cc
996007Ssteve.reinhardt@amd.com        cpu/o3/bpred_unit.cc
1006007Ssteve.reinhardt@amd.com        cpu/o3/btb.cc
1016007Ssteve.reinhardt@amd.com        cpu/o3/commit.cc
1026007Ssteve.reinhardt@amd.com        cpu/o3/decode.cc
1036007Ssteve.reinhardt@amd.com        cpu/o3/fetch.cc
1046007Ssteve.reinhardt@amd.com        cpu/o3/free_list.cc
1056011Ssteve.reinhardt@amd.com        cpu/o3/cpu.cc
1066007Ssteve.reinhardt@amd.com        cpu/o3/iew.cc
1076007Ssteve.reinhardt@amd.com        cpu/o3/inst_queue.cc
1086007Ssteve.reinhardt@amd.com        cpu/o3/ldstq.cc
1096007Ssteve.reinhardt@amd.com        cpu/o3/mem_dep_unit.cc
1106007Ssteve.reinhardt@amd.com        cpu/o3/ras.cc
1116007Ssteve.reinhardt@amd.com        cpu/o3/rename.cc
1126007Ssteve.reinhardt@amd.com        cpu/o3/rename_map.cc
1136011Ssteve.reinhardt@amd.com        cpu/o3/rob.cc
1146007Ssteve.reinhardt@amd.com        cpu/o3/sat_counter.cc
1156007Ssteve.reinhardt@amd.com        cpu/o3/store_set.cc
1166007Ssteve.reinhardt@amd.com        cpu/o3/tournament_pred.cc
1176007Ssteve.reinhardt@amd.com	cpu/fast/cpu.cc
1186007Ssteve.reinhardt@amd.com        cpu/sampler/sampler.cc
1196007Ssteve.reinhardt@amd.com        cpu/simple/cpu.cc
1206007Ssteve.reinhardt@amd.com        cpu/trace/reader/mem_trace_reader.cc
1216011Ssteve.reinhardt@amd.com        cpu/trace/reader/ibm_reader.cc
1226007Ssteve.reinhardt@amd.com        cpu/trace/reader/itx_reader.cc
1236007Ssteve.reinhardt@amd.com        cpu/trace/reader/m5_reader.cc
1246007Ssteve.reinhardt@amd.com        cpu/trace/opt_cpu.cc
1256007Ssteve.reinhardt@amd.com        cpu/trace/trace_cpu.cc
1266007Ssteve.reinhardt@amd.com
1276008Ssteve.reinhardt@amd.com	encumbered/mem/functional/main.cc
1286007Ssteve.reinhardt@amd.com
1296008Ssteve.reinhardt@amd.com        mem/memory.cc
1306008Ssteve.reinhardt@amd.com        mem/page_table.cc
1316008Ssteve.reinhardt@amd.com        mem/physical.cc
1326008Ssteve.reinhardt@amd.com        mem/proxy.cc
1336008Ssteve.reinhardt@amd.com
1346008Ssteve.reinhardt@amd.com        python/pyconfig.cc
1356008Ssteve.reinhardt@amd.com        python/embedded_py.cc
1366007Ssteve.reinhardt@amd.com
1376007Ssteve.reinhardt@amd.com	sim/builder.cc
1386007Ssteve.reinhardt@amd.com	sim/configfile.cc
1396007Ssteve.reinhardt@amd.com	sim/debug.cc
1406007Ssteve.reinhardt@amd.com	sim/eventq.cc
1412929Sktlim@umich.edu	sim/main.cc
1422929Sktlim@umich.edu	sim/param.cc
1432929Sktlim@umich.edu	sim/profile.cc
1442929Sktlim@umich.edu	sim/root.cc
1456007Ssteve.reinhardt@amd.com	sim/serialize.cc
1466007Ssteve.reinhardt@amd.com	sim/sim_events.cc
1472929Sktlim@umich.edu	sim/sim_exit.cc
1482929Sktlim@umich.edu	sim/sim_object.cc
1492929Sktlim@umich.edu	sim/startup.cc
1502929Sktlim@umich.edu	sim/stat_context.cc
1516007Ssteve.reinhardt@amd.com	sim/stat_control.cc
1526007Ssteve.reinhardt@amd.com	sim/system.cc
1532929Sktlim@umich.edu	sim/trace_context.cc
1542929Sktlim@umich.edu        ''')
1556007Ssteve.reinhardt@amd.com
1562929Sktlim@umich.edufull_cpu_sources = Split('''
1572929Sktlim@umich.edu	arch/alpha/full_cpu_exec.cc
1582929Sktlim@umich.edu	encumbered/cpu/full/bpred.cc
1592929Sktlim@umich.edu	encumbered/cpu/full/commit.cc
1602929Sktlim@umich.edu	encumbered/cpu/full/cpu.cc
1612929Sktlim@umich.edu	encumbered/cpu/full/create_vector.cc
1622929Sktlim@umich.edu	encumbered/cpu/full/cv_spec_state.cc
1634937Sstever@gmail.com	encumbered/cpu/full/dd_queue.cc
1644937Sstever@gmail.com	encumbered/cpu/full/dep_link.cc
1654937Sstever@gmail.com	encumbered/cpu/full/dispatch.cc
1664937Sstever@gmail.com	encumbered/cpu/full/dyn_inst.cc
1674937Sstever@gmail.com	encumbered/cpu/full/execute.cc
1684937Sstever@gmail.com	encumbered/cpu/full/fetch.cc
1694937Sstever@gmail.com	encumbered/cpu/full/floss_reasons.cc
1704937Sstever@gmail.com	encumbered/cpu/full/inst_fifo.cc
1714937Sstever@gmail.com	encumbered/cpu/full/instpipe.cc
1725773Snate@binkert.org	encumbered/cpu/full/issue.cc
1734937Sstever@gmail.com	encumbered/cpu/full/ls_queue.cc
1744937Sstever@gmail.com	encumbered/cpu/full/machine_queue.cc
1754937Sstever@gmail.com        encumbered/cpu/full/pipetrace.cc
1762929Sktlim@umich.edu        encumbered/cpu/full/readyq.cc
1772929Sktlim@umich.edu        encumbered/cpu/full/reg_info.cc
1782929Sktlim@umich.edu        encumbered/cpu/full/rob_station.cc
1795773Snate@binkert.org        encumbered/cpu/full/spec_memory.cc
1802929Sktlim@umich.edu        encumbered/cpu/full/spec_state.cc
1812929Sktlim@umich.edu        encumbered/cpu/full/storebuffer.cc
1822929Sktlim@umich.edu        encumbered/cpu/full/writeback.cc
1832929Sktlim@umich.edu        encumbered/cpu/full/iq/iq_station.cc
1842929Sktlim@umich.edu        encumbered/cpu/full/iq/iqueue.cc
1852929Sktlim@umich.edu        encumbered/cpu/full/iq/segmented/chain_info.cc
1864937Sstever@gmail.com        encumbered/cpu/full/iq/segmented/chain_wire.cc
1874937Sstever@gmail.com        encumbered/cpu/full/iq/segmented/iq_seg.cc
1884937Sstever@gmail.com        encumbered/cpu/full/iq/segmented/iq_segmented.cc
1894937Sstever@gmail.com        encumbered/cpu/full/iq/segmented/seg_chain.cc
1904937Sstever@gmail.com        encumbered/cpu/full/iq/seznec/iq_seznec.cc
1914937Sstever@gmail.com        encumbered/cpu/full/iq/standard/iq_standard.cc
1924937Sstever@gmail.com        ''')
1934937Sstever@gmail.com
1944937Sstever@gmail.com# MySql sources
1954937Sstever@gmail.commysql_sources = Split('''
1964937Sstever@gmail.com	base/mysql.cc
1974937Sstever@gmail.com	base/stats/mysql.cc
1984937Sstever@gmail.com        ''')
1994937Sstever@gmail.com
2004937Sstever@gmail.com# Full-system sources
2012929Sktlim@umich.edufull_system_sources = Split('''
2022929Sktlim@umich.edu	arch/alpha/alpha_memory.cc
2032929Sktlim@umich.edu	arch/alpha/arguments.cc
2042929Sktlim@umich.edu	arch/alpha/ev5.cc
2052929Sktlim@umich.edu	arch/alpha/osfpal.cc
2062929Sktlim@umich.edu	arch/alpha/pseudo_inst.cc
2072929Sktlim@umich.edu	arch/alpha/stacktrace.cc
2086011Ssteve.reinhardt@amd.com	arch/alpha/vtophys.cc
2092929Sktlim@umich.edu
2102929Sktlim@umich.edu	base/crc.cc
2112929Sktlim@umich.edu	base/inet.cc
2122929Sktlim@umich.edu	base/remote_gdb.cc
2132929Sktlim@umich.edu
2142929Sktlim@umich.edu	cpu/intr_control.cc
2152929Sktlim@umich.edu        cpu/profile.cc
2162929Sktlim@umich.edu
2172997Sstever@eecs.umich.edu	dev/alpha_console.cc
2182997Sstever@eecs.umich.edu	dev/baddev.cc
2192929Sktlim@umich.edu        dev/simconsole.cc
2202997Sstever@eecs.umich.edu	dev/disk_image.cc
2212997Sstever@eecs.umich.edu	dev/etherbus.cc
2222929Sktlim@umich.edu	dev/etherdump.cc
2232997Sstever@eecs.umich.edu	dev/etherint.cc
2242997Sstever@eecs.umich.edu	dev/etherlink.cc
2252997Sstever@eecs.umich.edu	dev/etherpkt.cc
2262929Sktlim@umich.edu	dev/ethertap.cc
2272997Sstever@eecs.umich.edu	dev/ide_ctrl.cc
2282997Sstever@eecs.umich.edu	dev/ide_disk.cc
2292997Sstever@eecs.umich.edu	dev/io_device.cc
2302997Sstever@eecs.umich.edu	dev/ns_gige.cc
2315773Snate@binkert.org	dev/pciconfigall.cc
2325773Snate@binkert.org	dev/pcidev.cc
2332997Sstever@eecs.umich.edu	dev/pcifake.cc
2342997Sstever@eecs.umich.edu	dev/pktfifo.cc
2356007Ssteve.reinhardt@amd.com	dev/platform.cc
2366007Ssteve.reinhardt@amd.com	dev/sinic.cc
2372997Sstever@eecs.umich.edu	dev/simple_disk.cc
2382929Sktlim@umich.edu	dev/tsunami.cc
2392997Sstever@eecs.umich.edu	dev/tsunami_cchip.cc
2402997Sstever@eecs.umich.edu	dev/isa_fake.cc
2412997Sstever@eecs.umich.edu	dev/tsunami_io.cc
2422997Sstever@eecs.umich.edu	dev/tsunami_pchip.cc
2432997Sstever@eecs.umich.edu	dev/uart.cc
2442997Sstever@eecs.umich.edu	dev/uart8250.cc
2452997Sstever@eecs.umich.edu
2462929Sktlim@umich.edu	kern/kernel_binning.cc
2472997Sstever@eecs.umich.edu	kern/kernel_stats.cc
2482929Sktlim@umich.edu	kern/system_events.cc
2492929Sktlim@umich.edu	kern/freebsd/freebsd_system.cc
2503005Sstever@eecs.umich.edu	kern/linux/linux_syscalls.cc
2513005Sstever@eecs.umich.edu	kern/linux/linux_system.cc
2523005Sstever@eecs.umich.edu	kern/linux/printk.cc
2533005Sstever@eecs.umich.edu	kern/tru64/dump_mbuf.cc
2546025Snate@binkert.org	kern/tru64/printf.cc
2556025Snate@binkert.org	kern/tru64/tru64_events.cc
2566025Snate@binkert.org	kern/tru64/tru64_syscalls.cc
2576025Snate@binkert.org	kern/tru64/tru64_system.cc
2586025Snate@binkert.org
2596025Snate@binkert.org	mem/functional/memory_control.cc
2604130Ssaidi@eecs.umich.edu        ''')
2614130Ssaidi@eecs.umich.edu
2624130Ssaidi@eecs.umich.edu# turbolaser encumbered sources
2633691Shsul@eecs.umich.eduturbolaser_sources = Split('''
2643005Sstever@eecs.umich.edu	encumbered/dev/dma.cc
2655721Shsul@eecs.umich.edu	encumbered/dev/etherdev.cc
2666194Sksewell@umich.edu	encumbered/dev/scsi.cc
2676194Sksewell@umich.edu	encumbered/dev/scsi_ctrl.cc
2683005Sstever@eecs.umich.edu	encumbered/dev/scsi_disk.cc
2696168Snate@binkert.org	encumbered/dev/scsi_none.cc
2706168Snate@binkert.org	encumbered/dev/tlaser_clock.cc
2716168Snate@binkert.org	encumbered/dev/tlaser_ipi.cc
2726166Ssteve.reinhardt@amd.com	encumbered/dev/tlaser_mbox.cc
2732929Sktlim@umich.edu	encumbered/dev/tlaser_mc146818.cc
2742929Sktlim@umich.edu	encumbered/dev/tlaser_node.cc
2753005Sstever@eecs.umich.edu	encumbered/dev/tlaser_pcia.cc
2762997Sstever@eecs.umich.edu	encumbered/dev/tlaser_pcidev.cc
2772997Sstever@eecs.umich.edu	encumbered/dev/tlaser_serial.cc
2786293Ssteve.reinhardt@amd.com	encumbered/dev/turbolaser.cc
2796293Ssteve.reinhardt@amd.com	encumbered/dev/uart8530.cc
2802929Sktlim@umich.edu        ''')
281
282# Syscall emulation (non-full-system) sources
283syscall_emulation_sources = Split('''
284	arch/alpha/alpha_common_syscall_emul.cc
285	arch/alpha/alpha_linux_process.cc
286	arch/alpha/alpha_tru64_process.cc
287	cpu/memtest/memtest.cc
288	encumbered/eio/eio.cc
289	encumbered/eio/exolex.cc
290	encumbered/eio/libexo.cc
291	sim/process.cc
292	sim/syscall_emul.cc
293        ''')
294
295targetarch_files = Split('''
296        alpha_common_syscall_emul.hh
297        alpha_linux_process.hh
298        alpha_memory.hh
299        alpha_tru64_process.hh
300        aout_machdep.h
301        arguments.hh
302        byte_swap.hh
303        ecoff_machdep.h
304        ev5.hh
305        faults.hh
306        isa_fullsys_traits.hh
307        isa_traits.hh
308        osfpal.hh
309        pseudo_inst.hh
310        stacktrace.hh
311        vptr.hh
312        vtophys.hh
313        ''')
314
315for f in targetarch_files:
316    env.Command('targetarch/' + f, 'arch/alpha/' + f,
317                '''echo '#include "arch/alpha/%s"' > $TARGET''' % f)
318
319
320# Set up complete list of sources based on configuration.
321sources = base_sources
322
323if env['FULL_SYSTEM']:
324    sources += full_system_sources
325    if env['ALPHA_TLASER']:
326        sources += turbolaser_sources
327else:
328    sources += syscall_emulation_sources
329
330if env['USE_MYSQL']:
331    sources += mysql_sources
332
333for opt in env.ExportOptions:
334    env.ConfigFile(opt)
335
336###################################################
337#
338# Special build rules.
339#
340###################################################
341
342# base/traceflags.{cc,hh} are generated from base/traceflags.py.
343# $TARGET.base will expand to "<build-dir>/base/traceflags".
344env.Command(Split('base/traceflags.hh base/traceflags.cc'),
345            'base/traceflags.py',
346            'python $SOURCE $TARGET.base')
347
348# several files are generated from arch/$TARGET_ISA/isa_desc.
349env.Command(Split('''arch/alpha/decoder.cc
350		     arch/alpha/decoder.hh
351                     arch/alpha/alpha_o3_exec.cc
352		     arch/alpha/fast_cpu_exec.cc
353                     arch/alpha/simple_cpu_exec.cc'''),
354            Split('''arch/alpha/isa_desc
355		     arch/isa_parser.py'''),
356            '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha')
357
358
359# libelf build is described in its own SConscript file.
360# SConscript-local is the per-config build, which just copies some
361# header files into a place where they can be found.
362SConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
363SConscript('python/SConscript', exports = ['env'], duplicate=0)
364
365# This function adds the specified sources to the given build
366# environment, and returns a list of all the corresponding SCons
367# Object nodes (including an extra one for date.cc).  We explicitly
368# add the Object nodes so we can set up special dependencies for
369# date.cc.
370def make_objs(sources, env):
371    objs = [env.Object(s) for s in sources]
372    # make date.cc depend on all other objects so it always gets
373    # recompiled whenever anything else does
374    date_obj = env.Object('base/date.cc')
375    env.Depends(date_obj, objs)
376    objs.append(date_obj)
377    return objs
378
379###################################################
380#
381# Define binaries.  Each different build type (debug, opt, etc.) gets
382# a slightly different build environment.
383#
384###################################################
385
386# Include file paths are rooted in this directory.  SCons will
387# automatically expand '.' to refer to both the source directory and
388# the corresponding build directory to pick up generated include
389# files.
390env.Append(CPPPATH='.')
391
392# Debug binary
393debugEnv = env.Copy(OBJSUFFIX='.do')
394debugEnv.Label = 'debug'
395debugEnv.Append(CCFLAGS=Split('-g -gstabs+ -O0'))
396debugEnv.Append(CPPDEFINES='DEBUG')
397tlist = debugEnv.Program(target = 'm5.debug',
398                         source = make_objs(sources, debugEnv))
399debugEnv.M5Binary = tlist[0]
400
401# Optimized binary
402optEnv = env.Copy()
403optEnv.Label = 'opt'
404optEnv.Append(CCFLAGS=Split('-g -O5'))
405tlist = optEnv.Program(target = 'm5.opt',
406                       source = make_objs(sources, optEnv))
407optEnv.M5Binary = tlist[0]
408
409# "Fast" binary
410fastEnv = env.Copy(OBJSUFFIX='.fo')
411fastEnv.Label = 'fast'
412fastEnv.Append(CCFLAGS=Split('-O5'))
413fastEnv.Append(CPPDEFINES='NDEBUG')
414fastEnv.Program(target = 'm5.fast.unstripped',
415                source = make_objs(sources, fastEnv))
416tlist = fastEnv.Command(target = 'm5.fast',
417                        source = 'm5.fast.unstripped',
418                        action = 'strip $SOURCE -o $TARGET')
419fastEnv.M5Binary = tlist[0]
420
421# Profiled binary
422profEnv = env.Copy(OBJSUFFIX='.po')
423profEnv.Label = 'prof'
424profEnv.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg')
425tlist = profEnv.Program(target = 'm5.prof',
426                        source = make_objs(sources, profEnv))
427profEnv.M5Binary = tlist[0]
428
429envList = [debugEnv, optEnv, fastEnv, profEnv]
430
431Return('envList')
432