SConscript revision 2315
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.orgimport os
30955SN/Aimport sys
315522Snate@binkert.orgfrom os.path import isdir
326143Snate@binkert.org
334762Snate@binkert.org# This file defines how to build a particular configuration of M5
345522Snate@binkert.org# based on variable settings in the 'env' build environment.
35955SN/A
365522Snate@binkert.org# Import build environment variable from SConstruct.
3711974Sgabeblack@google.comImport('env')
38955SN/A
395522Snate@binkert.org###################################################
404202Sbinkertn@umich.edu#
415742Snate@binkert.org# Define needed sources.
42955SN/A#
434381Sbinkertn@umich.edu###################################################
444381Sbinkertn@umich.edu
458334Snate@binkert.org# Base sources used by all configurations.
46955SN/A
47955SN/Abase_sources = Split('''
484202Sbinkertn@umich.edu	base/circlebuf.cc
49955SN/A	base/copyright.cc
504382Sbinkertn@umich.edu	base/cprintf.cc
514382Sbinkertn@umich.edu        base/embedfile.cc
524382Sbinkertn@umich.edu	base/fast_alloc.cc
536654Snate@binkert.org	base/fifo_buffer.cc
545517Snate@binkert.org	base/hostinfo.cc
558614Sgblack@eecs.umich.edu	base/hybrid_pred.cc
567674Snate@binkert.org	base/inifile.cc
576143Snate@binkert.org	base/intmath.cc
586143Snate@binkert.org	base/match.cc
596143Snate@binkert.org	base/misc.cc
608233Snate@binkert.org	base/output.cc
618233Snate@binkert.org	base/pollevent.cc
628233Snate@binkert.org	base/range.cc
638233Snate@binkert.org	base/random.cc
648233Snate@binkert.org	base/sat_counter.cc
658334Snate@binkert.org	base/socket.cc
668334Snate@binkert.org	base/statistics.cc
6710453SAndrew.Bardsley@arm.com	base/str.cc
6810453SAndrew.Bardsley@arm.com	base/time.cc
698233Snate@binkert.org	base/trace.cc
708233Snate@binkert.org	base/traceflags.cc
718233Snate@binkert.org	base/userinfo.cc
728233Snate@binkert.org	base/compression/lzss_compression.cc
738233Snate@binkert.org	base/loader/aout_object.cc
748233Snate@binkert.org	base/loader/ecoff_object.cc
7511983Sgabeblack@google.com	base/loader/elf_object.cc
7611983Sgabeblack@google.com	base/loader/object_file.cc
7711983Sgabeblack@google.com	base/loader/symtab.cc
7811983Sgabeblack@google.com	base/stats/events.cc
7911983Sgabeblack@google.com	base/stats/statdb.cc
8011983Sgabeblack@google.com	base/stats/visit.cc
8111983Sgabeblack@google.com	base/stats/text.cc
8211983Sgabeblack@google.com
8311983Sgabeblack@google.com	cpu/base.cc
8411983Sgabeblack@google.com        cpu/base_dyn_inst.cc
8511983Sgabeblack@google.com	cpu/cpu_exec_context.cc
866143Snate@binkert.org	cpu/exetrace.cc
878233Snate@binkert.org	cpu/pc_event.cc
888233Snate@binkert.org        cpu/quiesce_event.cc
898233Snate@binkert.org	cpu/static_inst.cc
906143Snate@binkert.org        cpu/sampler/sampler.cc
916143Snate@binkert.org        cpu/trace/reader/mem_trace_reader.cc
926143Snate@binkert.org        cpu/trace/reader/ibm_reader.cc
9311308Santhony.gutierrez@amd.com        cpu/trace/reader/itx_reader.cc
948233Snate@binkert.org        cpu/trace/reader/m5_reader.cc
958233Snate@binkert.org        cpu/trace/opt_cpu.cc
968233Snate@binkert.org        cpu/trace/trace_cpu.cc
9711983Sgabeblack@google.com
9811983Sgabeblack@google.com	encumbered/mem/functional/main.cc
994762Snate@binkert.org
1006143Snate@binkert.org	mem/base_hier.cc
1018233Snate@binkert.org	mem/base_mem.cc
1028233Snate@binkert.org	mem/hier_params.cc
1038233Snate@binkert.org	mem/mem_cmd.cc
1048233Snate@binkert.org	mem/mem_debug.cc
1058233Snate@binkert.org	mem/mem_req.cc
1066143Snate@binkert.org	mem/memory_interface.cc
1078233Snate@binkert.org	mem/bus/base_interface.cc
1088233Snate@binkert.org	mem/bus/bus.cc
1098233Snate@binkert.org	mem/bus/bus_bridge.cc
1108233Snate@binkert.org	mem/bus/bus_bridge_master.cc
1116143Snate@binkert.org	mem/bus/bus_bridge_slave.cc
1126143Snate@binkert.org	mem/bus/bus_interface.cc
1136143Snate@binkert.org	mem/bus/dma_bus_interface.cc
1146143Snate@binkert.org	mem/bus/dma_interface.cc
1156143Snate@binkert.org	mem/bus/master_interface.cc
1166143Snate@binkert.org	mem/bus/slave_interface.cc
1176143Snate@binkert.org	mem/cache/base_cache.cc
1186143Snate@binkert.org	mem/cache/cache.cc
1196143Snate@binkert.org	mem/cache/cache_builder.cc
1207065Snate@binkert.org	mem/cache/coherence/coherence_protocol.cc
1216143Snate@binkert.org	mem/cache/coherence/uni_coherence.cc
1228233Snate@binkert.org	mem/cache/miss/blocking_buffer.cc
1238233Snate@binkert.org	mem/cache/miss/miss_queue.cc
1248233Snate@binkert.org	mem/cache/miss/mshr.cc
1258233Snate@binkert.org	mem/cache/miss/mshr_queue.cc
1268233Snate@binkert.org        mem/cache/prefetch/base_prefetcher.cc
1278233Snate@binkert.org        mem/cache/prefetch/prefetcher.cc
1288233Snate@binkert.org        mem/cache/prefetch/tagged_prefetcher.cc
1298233Snate@binkert.org	mem/cache/tags/base_tags.cc
1308233Snate@binkert.org	mem/cache/tags/cache_tags.cc	
1318233Snate@binkert.org	mem/cache/tags/fa_lru.cc
1328233Snate@binkert.org	mem/cache/tags/iic.cc
1338233Snate@binkert.org	mem/cache/tags/lru.cc
1348233Snate@binkert.org	mem/cache/tags/repl/gen.cc
1358233Snate@binkert.org	mem/cache/tags/repl/repl.cc
1368233Snate@binkert.org	mem/cache/tags/split.cc
1378233Snate@binkert.org	mem/cache/tags/split_lru.cc
1388233Snate@binkert.org	mem/cache/tags/split_lifo.cc
1398233Snate@binkert.org	mem/functional/functional.cc
1408233Snate@binkert.org	mem/timing/base_memory.cc
1418233Snate@binkert.org        mem/timing/dram_memory.cc
1428233Snate@binkert.org        mem/timing/dram_mem_bank.cc
1438233Snate@binkert.org        mem/timing/dram_memory_builder.cc
1448233Snate@binkert.org	mem/timing/memory_builder.cc
1458233Snate@binkert.org	mem/timing/simple_mem_bank.cc
1468233Snate@binkert.org        mem/trace/itx_writer.cc
1478233Snate@binkert.org	mem/trace/mem_trace_writer.cc
1488233Snate@binkert.org	mem/trace/m5_writer.cc
1498233Snate@binkert.org
1508233Snate@binkert.org        python/pyconfig.cc
1518233Snate@binkert.org        python/embedded_py.cc
1528233Snate@binkert.org
1536143Snate@binkert.org	sim/builder.cc
1546143Snate@binkert.org	sim/configfile.cc
1556143Snate@binkert.org	sim/debug.cc
1566143Snate@binkert.org	sim/eventq.cc
1576143Snate@binkert.org	sim/faults.cc
1586143Snate@binkert.org	sim/main.cc
1599982Satgutier@umich.edu	sim/param.cc
16010196SCurtis.Dunham@arm.com	sim/profile.cc
16110196SCurtis.Dunham@arm.com	sim/root.cc
16210196SCurtis.Dunham@arm.com	sim/serialize.cc
16310196SCurtis.Dunham@arm.com	sim/sim_events.cc
16410196SCurtis.Dunham@arm.com	sim/sim_exit.cc
16510196SCurtis.Dunham@arm.com	sim/sim_object.cc
16610196SCurtis.Dunham@arm.com	sim/startup.cc
16710196SCurtis.Dunham@arm.com	sim/stat_context.cc
1686143Snate@binkert.org	sim/stat_control.cc
16911983Sgabeblack@google.com	sim/trace_context.cc
17011983Sgabeblack@google.com        ''')
17111983Sgabeblack@google.com
17211983Sgabeblack@google.com# Old FullCPU sources
17311983Sgabeblack@google.comfull_cpu_sources = Split('''
17411983Sgabeblack@google.com	encumbered/cpu/full/bpred.cc
17511983Sgabeblack@google.com	encumbered/cpu/full/commit.cc
17611983Sgabeblack@google.com	encumbered/cpu/full/cpu.cc
17711983Sgabeblack@google.com	encumbered/cpu/full/create_vector.cc
1786143Snate@binkert.org	encumbered/cpu/full/cv_spec_state.cc
17911988Sandreas.sandberg@arm.com	encumbered/cpu/full/dd_queue.cc
1808233Snate@binkert.org	encumbered/cpu/full/dep_link.cc
1818233Snate@binkert.org	encumbered/cpu/full/dispatch.cc
1826143Snate@binkert.org	encumbered/cpu/full/dyn_inst.cc
1838945Ssteve.reinhardt@amd.com	encumbered/cpu/full/execute.cc
1846143Snate@binkert.org	encumbered/cpu/full/fetch.cc
18511983Sgabeblack@google.com	encumbered/cpu/full/floss_reasons.cc
18611983Sgabeblack@google.com	encumbered/cpu/full/fu_pool.cc
1876143Snate@binkert.org	encumbered/cpu/full/inst_fifo.cc
1886143Snate@binkert.org	encumbered/cpu/full/instpipe.cc
1895522Snate@binkert.org	encumbered/cpu/full/issue.cc
1906143Snate@binkert.org	encumbered/cpu/full/ls_queue.cc
1916143Snate@binkert.org	encumbered/cpu/full/machine_queue.cc
1926143Snate@binkert.org        encumbered/cpu/full/pipetrace.cc
1939982Satgutier@umich.edu        encumbered/cpu/full/readyq.cc
1948233Snate@binkert.org        encumbered/cpu/full/reg_info.cc
1958233Snate@binkert.org        encumbered/cpu/full/rob_station.cc
1968233Snate@binkert.org        encumbered/cpu/full/spec_memory.cc
1976143Snate@binkert.org        encumbered/cpu/full/spec_state.cc
1986143Snate@binkert.org        encumbered/cpu/full/storebuffer.cc
1996143Snate@binkert.org        encumbered/cpu/full/writeback.cc
2006143Snate@binkert.org        encumbered/cpu/full/iq/iq_station.cc
2015522Snate@binkert.org        encumbered/cpu/full/iq/iqueue.cc
2025522Snate@binkert.org        encumbered/cpu/full/iq/segmented/chain_info.cc
2035522Snate@binkert.org        encumbered/cpu/full/iq/segmented/chain_wire.cc
2045522Snate@binkert.org        encumbered/cpu/full/iq/segmented/iq_seg.cc
2055604Snate@binkert.org        encumbered/cpu/full/iq/segmented/iq_segmented.cc
2065604Snate@binkert.org        encumbered/cpu/full/iq/segmented/seg_chain.cc
2076143Snate@binkert.org        encumbered/cpu/full/iq/seznec/iq_seznec.cc
2086143Snate@binkert.org        encumbered/cpu/full/iq/standard/iq_standard.cc
2094762Snate@binkert.org        ''')
2104762Snate@binkert.org
2116143Snate@binkert.org# MySql sources
2126727Ssteve.reinhardt@amd.commysql_sources = Split('''
2136727Ssteve.reinhardt@amd.com	base/mysql.cc
2146727Ssteve.reinhardt@amd.com	base/stats/mysql.cc
2154762Snate@binkert.org        ''')
2166143Snate@binkert.org
2176143Snate@binkert.org# Full-system sources
2186143Snate@binkert.orgfull_system_sources = Split('''
2196143Snate@binkert.org	base/crc.cc
2206727Ssteve.reinhardt@amd.com	base/inet.cc
2216143Snate@binkert.org	base/remote_gdb.cc
2227674Snate@binkert.org
2237674Snate@binkert.org	cpu/intr_control.cc
2245604Snate@binkert.org        cpu/profile.cc
2256143Snate@binkert.org
2266143Snate@binkert.org	dev/alpha_console.cc
2276143Snate@binkert.org	dev/baddev.cc
2284762Snate@binkert.org        dev/simconsole.cc
2296143Snate@binkert.org	dev/disk_image.cc
2304762Snate@binkert.org	dev/etherbus.cc
2314762Snate@binkert.org	dev/etherdump.cc
2324762Snate@binkert.org	dev/etherint.cc
2336143Snate@binkert.org	dev/etherlink.cc
2346143Snate@binkert.org	dev/etherpkt.cc
2354762Snate@binkert.org	dev/ethertap.cc
2368233Snate@binkert.org	dev/ide_ctrl.cc
2378233Snate@binkert.org	dev/ide_disk.cc
2388233Snate@binkert.org	dev/io_device.cc
2398233Snate@binkert.org	dev/ns_gige.cc
2406143Snate@binkert.org	dev/pciconfigall.cc
2416143Snate@binkert.org	dev/pcidev.cc
2424762Snate@binkert.org	dev/pcifake.cc
2436143Snate@binkert.org	dev/pktfifo.cc
2444762Snate@binkert.org	dev/platform.cc
2459396Sandreas.hansson@arm.com	dev/sinic.cc
2469396Sandreas.hansson@arm.com	dev/simple_disk.cc
2479396Sandreas.hansson@arm.com	dev/tsunami.cc
2489396Sandreas.hansson@arm.com	dev/tsunami_cchip.cc
2499396Sandreas.hansson@arm.com	dev/isa_fake.cc
2509396Sandreas.hansson@arm.com	dev/tsunami_io.cc
2519396Sandreas.hansson@arm.com	dev/tsunami_pchip.cc
2529396Sandreas.hansson@arm.com	dev/uart.cc
2539396Sandreas.hansson@arm.com	dev/uart8250.cc
2549396Sandreas.hansson@arm.com
2559396Sandreas.hansson@arm.com	kern/kernel_binning.cc
2569396Sandreas.hansson@arm.com	kern/kernel_stats.cc
2579396Sandreas.hansson@arm.com	kern/system_events.cc
2589930Sandreas.hansson@arm.com	kern/linux/events.cc
2599930Sandreas.hansson@arm.com	kern/linux/linux_syscalls.cc
2609396Sandreas.hansson@arm.com	kern/linux/printk.cc
2618235Snate@binkert.org	kern/tru64/dump_mbuf.cc
2628235Snate@binkert.org	kern/tru64/printf.cc
2636143Snate@binkert.org	kern/tru64/tru64_events.cc
2648235Snate@binkert.org	kern/tru64/tru64_syscalls.cc
2659003SAli.Saidi@ARM.com
2668235Snate@binkert.org	mem/functional/memory_control.cc
2678235Snate@binkert.org	mem/functional/physical.cc
2688235Snate@binkert.org
2698235Snate@binkert.org	sim/system.cc
2708235Snate@binkert.org	sim/pseudo_inst.cc
2718235Snate@binkert.org        ''')
2728235Snate@binkert.org
2738235Snate@binkert.org# turbolaser encumbered sources
2748235Snate@binkert.orgturbolaser_sources = Split('''
2758235Snate@binkert.org	encumbered/dev/dma.cc
2768235Snate@binkert.org	encumbered/dev/etherdev.cc
2778235Snate@binkert.org	encumbered/dev/scsi.cc
2788235Snate@binkert.org	encumbered/dev/scsi_ctrl.cc
2798235Snate@binkert.org	encumbered/dev/scsi_disk.cc
2809003SAli.Saidi@ARM.com	encumbered/dev/scsi_none.cc
2818235Snate@binkert.org	encumbered/dev/tlaser_clock.cc
2825584Snate@binkert.org	encumbered/dev/tlaser_ipi.cc
2834382Sbinkertn@umich.edu	encumbered/dev/tlaser_mbox.cc
2844202Sbinkertn@umich.edu	encumbered/dev/tlaser_mc146818.cc
2854382Sbinkertn@umich.edu	encumbered/dev/tlaser_node.cc
2864382Sbinkertn@umich.edu	encumbered/dev/tlaser_pcia.cc
2879396Sandreas.hansson@arm.com	encumbered/dev/tlaser_pcidev.cc
2885584Snate@binkert.org	encumbered/dev/tlaser_serial.cc
2894382Sbinkertn@umich.edu	encumbered/dev/turbolaser.cc
2904382Sbinkertn@umich.edu	encumbered/dev/uart8530.cc
2914382Sbinkertn@umich.edu        ''')
2928232Snate@binkert.org
2935192Ssaidi@eecs.umich.edu# Syscall emulation (non-full-system) sources
2948232Snate@binkert.orgsyscall_emulation_sources = Split('''
2958232Snate@binkert.org	cpu/memtest/memtest.cc
2968232Snate@binkert.org	encumbered/eio/eio.cc
2975192Ssaidi@eecs.umich.edu	encumbered/eio/exolex.cc
2988232Snate@binkert.org	encumbered/eio/libexo.cc
2995192Ssaidi@eecs.umich.edu        kern/linux/linux.cc
3005799Snate@binkert.org        kern/tru64/tru64.cc
3018232Snate@binkert.org	sim/process.cc
3025192Ssaidi@eecs.umich.edu	sim/syscall_emul.cc
3035192Ssaidi@eecs.umich.edu        ''')
3045192Ssaidi@eecs.umich.edu
3058232Snate@binkert.org# Add a flag defining what THE_ISA should be for all compilation
3065192Ssaidi@eecs.umich.eduenv.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())])
3078232Snate@binkert.org
3085192Ssaidi@eecs.umich.eduarch_sources = SConscript('arch/SConscript',
3095192Ssaidi@eecs.umich.edu                          exports = 'env', duplicate = False)
3105192Ssaidi@eecs.umich.edu
3115192Ssaidi@eecs.umich.educpu_sources = SConscript('cpu/SConscript',
3124382Sbinkertn@umich.edu                         exports = 'env', duplicate = False)
3134382Sbinkertn@umich.edu
3144382Sbinkertn@umich.edu# This is outside of cpu/SConscript since the source directory isn't
3152667Sstever@eecs.umich.edu# underneath 'cpu'.
3162667Sstever@eecs.umich.eduif 'FullCPU' in env['CPU_MODELS']:
3172667Sstever@eecs.umich.edu    cpu_sources += full_cpu_sources
3182667Sstever@eecs.umich.edu
3192667Sstever@eecs.umich.edu# Set up complete list of sources based on configuration.
3202667Sstever@eecs.umich.edusources = base_sources + arch_sources + cpu_sources
3215742Snate@binkert.org
3225742Snate@binkert.orgif env['FULL_SYSTEM']:
3235742Snate@binkert.org    sources += full_system_sources
3245793Snate@binkert.org    if env['ALPHA_TLASER']:
3258334Snate@binkert.org        sources += turbolaser_sources
3265793Snate@binkert.orgelse:
3275793Snate@binkert.org    sources += syscall_emulation_sources
3285793Snate@binkert.org
3294382Sbinkertn@umich.eduif env['USE_MYSQL']:
3304762Snate@binkert.org    sources += mysql_sources
3315344Sstever@gmail.com
3324382Sbinkertn@umich.edufor opt in env.ExportOptions:
3335341Sstever@gmail.com    env.ConfigFile(opt)
3345742Snate@binkert.org
3355742Snate@binkert.org###################################################
3365742Snate@binkert.org#
3375742Snate@binkert.org# Special build rules.
3385742Snate@binkert.org#
3394762Snate@binkert.org###################################################
3405742Snate@binkert.org
3415742Snate@binkert.org# base/traceflags.{cc,hh} are generated from base/traceflags.py.
34211984Sgabeblack@google.com# $TARGET.base will expand to "<build-dir>/base/traceflags".
3437722Sgblack@eecs.umich.eduenv.Command(Split('base/traceflags.hh base/traceflags.cc'),
3445742Snate@binkert.org            'base/traceflags.py',
3455742Snate@binkert.org            'python $SOURCE $TARGET.base')
3465742Snate@binkert.org
3479930Sandreas.hansson@arm.com# libelf build is described in its own SConscript file.
3489930Sandreas.hansson@arm.com# SConscript-local is the per-config build, which just copies some
3499930Sandreas.hansson@arm.com# header files into a place where they can be found.
3509930Sandreas.hansson@arm.comSConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
3519930Sandreas.hansson@arm.comSConscript('python/SConscript', exports = ['env'], duplicate=0)
3525742Snate@binkert.org
3538242Sbradley.danofsky@amd.com# This function adds the specified sources to the given build
3548242Sbradley.danofsky@amd.com# environment, and returns a list of all the corresponding SCons
3558242Sbradley.danofsky@amd.com# Object nodes (including an extra one for date.cc).  We explicitly
3568242Sbradley.danofsky@amd.com# add the Object nodes so we can set up special dependencies for
3575341Sstever@gmail.com# date.cc.
3585742Snate@binkert.orgdef make_objs(sources, env):
3597722Sgblack@eecs.umich.edu    objs = [env.Object(s) for s in sources]
3604773Snate@binkert.org    # make date.cc depend on all other objects so it always gets
3616108Snate@binkert.org    # recompiled whenever anything else does
3621858SN/A    date_obj = env.Object('base/date.cc')
3631085SN/A    env.Depends(date_obj, objs)
3646658Snate@binkert.org    objs.append(date_obj)
3656658Snate@binkert.org    return objs
3667673Snate@binkert.org
3676658Snate@binkert.org###################################################
3686658Snate@binkert.org#
36911308Santhony.gutierrez@amd.com# Define binaries.  Each different build type (debug, opt, etc.) gets
3706658Snate@binkert.org# a slightly different build environment.
37111308Santhony.gutierrez@amd.com#
3726658Snate@binkert.org###################################################
3736658Snate@binkert.org
3747673Snate@binkert.org# Include file paths are rooted in this directory.  SCons will
3757673Snate@binkert.org# automatically expand '.' to refer to both the source directory and
3767673Snate@binkert.org# the corresponding build directory to pick up generated include
3777673Snate@binkert.org# files.
3787673Snate@binkert.orgenv.Append(CPPPATH='.')
3797673Snate@binkert.orgenv.Append(CPPPATH='./libelf')
3807673Snate@binkert.org
38110467Sandreas.hansson@arm.com# Debug binary
3826658Snate@binkert.orgdebugEnv = env.Copy(OBJSUFFIX='.do')
3837673Snate@binkert.orgdebugEnv.Label = 'debug'
38410467Sandreas.hansson@arm.comdebugEnv.Append(CCFLAGS=Split('-g -gdwarf-2 -O0'))
38510467Sandreas.hansson@arm.comdebugEnv.Append(CPPDEFINES='DEBUG')
38610467Sandreas.hansson@arm.comtlist = debugEnv.Program(target = 'm5.debug',
38710467Sandreas.hansson@arm.com                         source = make_objs(sources, debugEnv))
38810467Sandreas.hansson@arm.comdebugEnv.M5Binary = tlist[0]
38910467Sandreas.hansson@arm.com
39010467Sandreas.hansson@arm.com# Optimized binary
39110467Sandreas.hansson@arm.comoptEnv = env.Copy()
39210467Sandreas.hansson@arm.comoptEnv.Label = 'opt'
39310467Sandreas.hansson@arm.comoptEnv.Append(CCFLAGS=Split('-g -O5'))
39410467Sandreas.hansson@arm.comtlist = optEnv.Program(target = 'm5.opt',
3957673Snate@binkert.org                       source = make_objs(sources, optEnv))
3967673Snate@binkert.orgoptEnv.M5Binary = tlist[0]
3977673Snate@binkert.org
3987673Snate@binkert.org# "Fast" binary
3997673Snate@binkert.orgfastEnv = env.Copy(OBJSUFFIX='.fo')
4009048SAli.Saidi@ARM.comfastEnv.Label = 'fast'
4017673Snate@binkert.orgfastEnv.Append(CCFLAGS=Split('-O5'))
4027673Snate@binkert.orgfastEnv.Append(CPPDEFINES='NDEBUG')
4037673Snate@binkert.orgfastEnv.Program(target = 'm5.fast.unstripped',
4047673Snate@binkert.org                source = make_objs(sources, fastEnv))
4056658Snate@binkert.orgtlist = fastEnv.Command(target = 'm5.fast',
4067756SAli.Saidi@ARM.com                        source = 'm5.fast.unstripped',
4077816Ssteve.reinhardt@amd.com                        action = 'strip $SOURCE -o $TARGET')
4086658Snate@binkert.orgfastEnv.M5Binary = tlist[0]
40911308Santhony.gutierrez@amd.com
41011308Santhony.gutierrez@amd.com# Profiled binary
41111308Santhony.gutierrez@amd.comprofEnv = env.Copy(OBJSUFFIX='.po')
41211308Santhony.gutierrez@amd.comprofEnv.Label = 'prof'
41311308Santhony.gutierrez@amd.comprofEnv.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg')
41411308Santhony.gutierrez@amd.comtlist = profEnv.Program(target = 'm5.prof',
41511308Santhony.gutierrez@amd.com                        source = make_objs(sources, profEnv))
41611308Santhony.gutierrez@amd.comprofEnv.M5Binary = tlist[0]
41711308Santhony.gutierrez@amd.com
41811308Santhony.gutierrez@amd.comenvList = [debugEnv, optEnv, fastEnv, profEnv]
41911308Santhony.gutierrez@amd.com
42011308Santhony.gutierrez@amd.comReturn('envList')
42111308Santhony.gutierrez@amd.com