SConscript revision 2405
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
314762Snate@binkert.orgfrom os.path import isdir
32955SN/A
33955SN/A# This file defines how to build a particular configuration of M5
344202Sbinkertn@umich.edu# based on variable settings in the 'env' build environment.
355342Sstever@gmail.com
36955SN/A# Import build environment variable from SConstruct.
374381Sbinkertn@umich.eduImport('env')
384381Sbinkertn@umich.edu
39955SN/A###################################################
40955SN/A#
41955SN/A# Define needed sources.
424202Sbinkertn@umich.edu#
43955SN/A###################################################
444382Sbinkertn@umich.edu
454382Sbinkertn@umich.edu# Base sources used by all configurations.
464382Sbinkertn@umich.edubase_sources = Split('''
474762Snate@binkert.org	arch/alpha/decoder.cc
484762Snate@binkert.org	arch/alpha/faults.cc
494762Snate@binkert.org	arch/alpha/isa_traits.cc
504762Snate@binkert.org
514762Snate@binkert.org	base/circlebuf.cc
524762Snate@binkert.org	base/copyright.cc
534762Snate@binkert.org	base/cprintf.cc
544762Snate@binkert.org        base/embedfile.cc
554762Snate@binkert.org	base/fast_alloc.cc
564762Snate@binkert.org	base/fifo_buffer.cc
574762Snate@binkert.org	base/hostinfo.cc
584762Snate@binkert.org	base/hybrid_pred.cc
594762Snate@binkert.org	base/inifile.cc
604762Snate@binkert.org	base/intmath.cc
614762Snate@binkert.org	base/match.cc
624762Snate@binkert.org	base/misc.cc
634762Snate@binkert.org	base/output.cc
644762Snate@binkert.org	base/pollevent.cc
654762Snate@binkert.org	base/range.cc
664762Snate@binkert.org	base/random.cc
674762Snate@binkert.org	base/sat_counter.cc
684762Snate@binkert.org	base/socket.cc
694762Snate@binkert.org	base/statistics.cc
704762Snate@binkert.org	base/str.cc
714762Snate@binkert.org	base/time.cc
724762Snate@binkert.org	base/trace.cc
734762Snate@binkert.org	base/traceflags.cc
744762Snate@binkert.org	base/userinfo.cc
754762Snate@binkert.org	base/compression/lzss_compression.cc
764762Snate@binkert.org	base/loader/aout_object.cc
774762Snate@binkert.org	base/loader/ecoff_object.cc
784762Snate@binkert.org	base/loader/elf_object.cc
794762Snate@binkert.org	base/loader/object_file.cc
804382Sbinkertn@umich.edu	base/loader/symtab.cc
814762Snate@binkert.org	base/stats/events.cc
824382Sbinkertn@umich.edu	base/stats/statdb.cc
834762Snate@binkert.org	base/stats/visit.cc
844381Sbinkertn@umich.edu	base/stats/text.cc
854762Snate@binkert.org
864762Snate@binkert.org	cpu/base.cc
874762Snate@binkert.org	cpu/exec_context.cc
884762Snate@binkert.org	cpu/exetrace.cc
894762Snate@binkert.org	cpu/pc_event.cc
904762Snate@binkert.org	cpu/static_inst.cc
914762Snate@binkert.org        cpu/sampler/sampler.cc
924762Snate@binkert.org
934762Snate@binkert.org        mem/memory.cc
944762Snate@binkert.org        mem/page_table.cc
954762Snate@binkert.org        mem/physical.cc
964762Snate@binkert.org        mem/port.cc
974762Snate@binkert.org        mem/translating_port.cc
984762Snate@binkert.org
994762Snate@binkert.org        python/pyconfig.cc
1004762Snate@binkert.org        python/embedded_py.cc
1014762Snate@binkert.org
1024762Snate@binkert.org	sim/builder.cc
1034762Snate@binkert.org	sim/configfile.cc
1044762Snate@binkert.org	sim/debug.cc
1054762Snate@binkert.org	sim/eventq.cc
1064762Snate@binkert.org	sim/main.cc
1074762Snate@binkert.org	sim/param.cc
1084762Snate@binkert.org	sim/profile.cc
1094762Snate@binkert.org	sim/root.cc
1104762Snate@binkert.org	sim/serialize.cc
1114762Snate@binkert.org	sim/sim_events.cc
1124762Snate@binkert.org	sim/sim_exit.cc
1134762Snate@binkert.org	sim/sim_object.cc
1144762Snate@binkert.org	sim/startup.cc
1154762Snate@binkert.org	sim/stat_context.cc
1164762Snate@binkert.org	sim/stat_control.cc
1174762Snate@binkert.org	sim/system.cc
1184762Snate@binkert.org	sim/trace_context.cc
1194762Snate@binkert.org        ''')
1204762Snate@binkert.org
1214762Snate@binkert.orgfast_cpu_sources = Split('''
1224762Snate@binkert.org	arch/alpha/fast_cpu_exec.cc
1234762Snate@binkert.org	cpu/fast/cpu.cc
1244762Snate@binkert.org        ''')
125955SN/A
1264382Sbinkertn@umich.edusimple_cpu_sources = Split('''
1274202Sbinkertn@umich.edu	arch/alpha/simple_cpu_exec.cc
1284382Sbinkertn@umich.edu        cpu/simple/cpu.cc
1294382Sbinkertn@umich.edu        ''')
1304382Sbinkertn@umich.edu
1314382Sbinkertn@umich.edutrace_reader_sources = Split('''
1324382Sbinkertn@umich.edu        cpu/trace/reader/mem_trace_reader.cc
1334382Sbinkertn@umich.edu        cpu/trace/reader/ibm_reader.cc
1345192Ssaidi@eecs.umich.edu        cpu/trace/reader/itx_reader.cc
1355192Ssaidi@eecs.umich.edu        cpu/trace/reader/m5_reader.cc
1365192Ssaidi@eecs.umich.edu        cpu/trace/opt_cpu.cc
1375192Ssaidi@eecs.umich.edu        cpu/trace/trace_cpu.cc
1385192Ssaidi@eecs.umich.edu        ''')
1395192Ssaidi@eecs.umich.edu
1405192Ssaidi@eecs.umich.edufull_cpu_sources = Split('''
1415192Ssaidi@eecs.umich.edu	arch/alpha/full_cpu_exec.cc
1425192Ssaidi@eecs.umich.edu        cpu/base_dyn_inst.cc
1435192Ssaidi@eecs.umich.edu	encumbered/cpu/full/bpred.cc
1445192Ssaidi@eecs.umich.edu	encumbered/cpu/full/commit.cc
1455192Ssaidi@eecs.umich.edu	encumbered/cpu/full/cpu.cc
1465192Ssaidi@eecs.umich.edu	encumbered/cpu/full/create_vector.cc
1475192Ssaidi@eecs.umich.edu	encumbered/cpu/full/cv_spec_state.cc
1485192Ssaidi@eecs.umich.edu	encumbered/cpu/full/dd_queue.cc
1495192Ssaidi@eecs.umich.edu	encumbered/cpu/full/dep_link.cc
1505192Ssaidi@eecs.umich.edu	encumbered/cpu/full/dispatch.cc
1515192Ssaidi@eecs.umich.edu	encumbered/cpu/full/dyn_inst.cc
1525192Ssaidi@eecs.umich.edu	encumbered/cpu/full/execute.cc
1535192Ssaidi@eecs.umich.edu	encumbered/cpu/full/fetch.cc
1545192Ssaidi@eecs.umich.edu	encumbered/cpu/full/floss_reasons.cc
1555192Ssaidi@eecs.umich.edu	encumbered/cpu/full/inst_fifo.cc
1565192Ssaidi@eecs.umich.edu	encumbered/cpu/full/instpipe.cc
1575192Ssaidi@eecs.umich.edu	encumbered/cpu/full/issue.cc
1585192Ssaidi@eecs.umich.edu	encumbered/cpu/full/ls_queue.cc
1595192Ssaidi@eecs.umich.edu	encumbered/cpu/full/machine_queue.cc
1605192Ssaidi@eecs.umich.edu        encumbered/cpu/full/pipetrace.cc
1615192Ssaidi@eecs.umich.edu        encumbered/cpu/full/readyq.cc
1625192Ssaidi@eecs.umich.edu        encumbered/cpu/full/reg_info.cc
1635192Ssaidi@eecs.umich.edu        encumbered/cpu/full/rob_station.cc
1645192Ssaidi@eecs.umich.edu        encumbered/cpu/full/spec_memory.cc
1655192Ssaidi@eecs.umich.edu        encumbered/cpu/full/spec_state.cc
1664382Sbinkertn@umich.edu        encumbered/cpu/full/storebuffer.cc
1674382Sbinkertn@umich.edu        encumbered/cpu/full/writeback.cc
1684382Sbinkertn@umich.edu        encumbered/cpu/full/iq/iq_station.cc
1692667Sstever@eecs.umich.edu        encumbered/cpu/full/iq/iqueue.cc
1702667Sstever@eecs.umich.edu        encumbered/cpu/full/iq/segmented/chain_info.cc
1712667Sstever@eecs.umich.edu        encumbered/cpu/full/iq/segmented/chain_wire.cc
1722667Sstever@eecs.umich.edu        encumbered/cpu/full/iq/segmented/iq_seg.cc
1732667Sstever@eecs.umich.edu        encumbered/cpu/full/iq/segmented/iq_segmented.cc
1742667Sstever@eecs.umich.edu        encumbered/cpu/full/iq/segmented/seg_chain.cc
1752037SN/A        encumbered/cpu/full/iq/seznec/iq_seznec.cc
1762037SN/A        encumbered/cpu/full/iq/standard/iq_standard.cc
1772037SN/A        ''')
1784382Sbinkertn@umich.edu
1794762Snate@binkert.orgo3_cpu_sources = Split('''
1805341Sstever@gmail.com        arch/alpha/alpha_o3_exec.cc
1814382Sbinkertn@umich.edu        cpu/o3/2bit_local_pred.cc
1825341Sstever@gmail.com        cpu/o3/alpha_dyn_inst.cc
1835341Sstever@gmail.com        cpu/o3/alpha_cpu.cc
1845341Sstever@gmail.com        cpu/o3/alpha_cpu_builder.cc
1855341Sstever@gmail.com        cpu/o3/bpred_unit.cc
1864202Sbinkertn@umich.edu        cpu/o3/btb.cc
1875341Sstever@gmail.com        cpu/o3/commit.cc
1885341Sstever@gmail.com        cpu/o3/decode.cc
1895341Sstever@gmail.com        cpu/o3/fetch.cc
1905341Sstever@gmail.com        cpu/o3/free_list.cc
1915341Sstever@gmail.com        cpu/o3/cpu.cc
1924762Snate@binkert.org        cpu/o3/iew.cc
1935341Sstever@gmail.com        cpu/o3/inst_queue.cc
1945341Sstever@gmail.com        cpu/o3/ldstq.cc
1955341Sstever@gmail.com        cpu/o3/mem_dep_unit.cc
1964773Snate@binkert.org        cpu/o3/ras.cc
1971858SN/A        cpu/o3/rename.cc
1981858SN/A        cpu/o3/rename_map.cc
1991085SN/A        cpu/o3/rob.cc
2004382Sbinkertn@umich.edu        cpu/o3/sat_counter.cc
2014382Sbinkertn@umich.edu        cpu/o3/store_set.cc
2024762Snate@binkert.org        cpu/o3/tournament_pred.cc
2034762Snate@binkert.org        ''')
2044762Snate@binkert.org
2054762Snate@binkert.org# MySql sources
2064762Snate@binkert.orgmysql_sources = Split('''
2074762Snate@binkert.org	base/mysql.cc
2084762Snate@binkert.org	base/stats/mysql.cc
2094762Snate@binkert.org        ''')
2104762Snate@binkert.org
2114762Snate@binkert.org# Full-system sources
2124762Snate@binkert.orgfull_system_sources = Split('''
2134762Snate@binkert.org	arch/alpha/alpha_memory.cc
2144762Snate@binkert.org	arch/alpha/arguments.cc
2154762Snate@binkert.org	arch/alpha/ev5.cc
2164762Snate@binkert.org	arch/alpha/osfpal.cc
2174762Snate@binkert.org	arch/alpha/pseudo_inst.cc
2184762Snate@binkert.org	arch/alpha/stacktrace.cc
2194762Snate@binkert.org	arch/alpha/vtophys.cc
2204762Snate@binkert.org
2214762Snate@binkert.org	base/crc.cc
2224762Snate@binkert.org	base/inet.cc
2234762Snate@binkert.org	base/remote_gdb.cc
2244762Snate@binkert.org
2254762Snate@binkert.org	cpu/intr_control.cc
2264762Snate@binkert.org        cpu/profile.cc
2274762Snate@binkert.org
2284762Snate@binkert.org	dev/alpha_console.cc
2294762Snate@binkert.org	dev/baddev.cc
2304762Snate@binkert.org        dev/simconsole.cc
2314762Snate@binkert.org	dev/disk_image.cc
2324762Snate@binkert.org	dev/etherbus.cc
2334762Snate@binkert.org	dev/etherdump.cc
2344762Snate@binkert.org	dev/etherint.cc
2354762Snate@binkert.org	dev/etherlink.cc
2364762Snate@binkert.org	dev/etherpkt.cc
2374382Sbinkertn@umich.edu	dev/ethertap.cc
2384382Sbinkertn@umich.edu	dev/ide_ctrl.cc
2394762Snate@binkert.org	dev/ide_disk.cc
2404762Snate@binkert.org	dev/io_device.cc
2414762Snate@binkert.org	dev/ns_gige.cc
2424382Sbinkertn@umich.edu	dev/pciconfigall.cc
2434382Sbinkertn@umich.edu	dev/pcidev.cc
2444762Snate@binkert.org	dev/pcifake.cc
2454382Sbinkertn@umich.edu	dev/pktfifo.cc
2464382Sbinkertn@umich.edu	dev/platform.cc
2474762Snate@binkert.org	dev/sinic.cc
2484382Sbinkertn@umich.edu	dev/simple_disk.cc
2494382Sbinkertn@umich.edu	dev/tsunami.cc
2504762Snate@binkert.org	dev/tsunami_cchip.cc
2514382Sbinkertn@umich.edu	dev/isa_fake.cc
2524762Snate@binkert.org	dev/tsunami_io.cc
2534762Snate@binkert.org	dev/tsunami_pchip.cc
2544382Sbinkertn@umich.edu	dev/uart.cc
2554382Sbinkertn@umich.edu	dev/uart8250.cc
2564762Snate@binkert.org
2574762Snate@binkert.org	kern/kernel_binning.cc
2584762Snate@binkert.org	kern/kernel_stats.cc
2594762Snate@binkert.org	kern/system_events.cc
2604762Snate@binkert.org	kern/freebsd/freebsd_system.cc
2614762Snate@binkert.org	kern/linux/linux_syscalls.cc
2624762Snate@binkert.org	kern/linux/linux_system.cc
2634762Snate@binkert.org	kern/linux/printk.cc
2644762Snate@binkert.org	kern/tru64/dump_mbuf.cc
2654762Snate@binkert.org	kern/tru64/printf.cc
2664762Snate@binkert.org	kern/tru64/tru64_events.cc
2674762Snate@binkert.org	kern/tru64/tru64_syscalls.cc
2684762Snate@binkert.org	kern/tru64/tru64_system.cc
2694762Snate@binkert.org
2704762Snate@binkert.org	mem/functional/memory_control.cc
2714762Snate@binkert.org        ''')
2724762Snate@binkert.org
2734762Snate@binkert.org# turbolaser encumbered sources
2744762Snate@binkert.orgturbolaser_sources = Split('''
2754762Snate@binkert.org	encumbered/dev/dma.cc
2764762Snate@binkert.org	encumbered/dev/etherdev.cc
2774762Snate@binkert.org	encumbered/dev/scsi.cc
2784762Snate@binkert.org	encumbered/dev/scsi_ctrl.cc
2794762Snate@binkert.org	encumbered/dev/scsi_disk.cc
2804762Snate@binkert.org	encumbered/dev/scsi_none.cc
2814762Snate@binkert.org	encumbered/dev/tlaser_clock.cc
2824762Snate@binkert.org	encumbered/dev/tlaser_ipi.cc
2834762Snate@binkert.org	encumbered/dev/tlaser_mbox.cc
2844762Snate@binkert.org	encumbered/dev/tlaser_mc146818.cc
2854762Snate@binkert.org	encumbered/dev/tlaser_node.cc
2864762Snate@binkert.org	encumbered/dev/tlaser_pcia.cc
2874762Snate@binkert.org	encumbered/dev/tlaser_pcidev.cc
2884762Snate@binkert.org	encumbered/dev/tlaser_serial.cc
2894762Snate@binkert.org	encumbered/dev/turbolaser.cc
2904762Snate@binkert.org	encumbered/dev/uart8530.cc
2914762Snate@binkert.org        ''')
2924762Snate@binkert.org
2934762Snate@binkert.org# Syscall emulation (non-full-system) sources
2944762Snate@binkert.orgsyscall_emulation_sources = Split('''
2954762Snate@binkert.org	arch/alpha/alpha_common_syscall_emul.cc
2964762Snate@binkert.org	arch/alpha/alpha_linux_process.cc
2974762Snate@binkert.org	arch/alpha/alpha_tru64_process.cc
2984762Snate@binkert.org
2994762Snate@binkert.org	encumbered/eio/exolex.cc
3004762Snate@binkert.org	encumbered/eio/libexo.cc
3014762Snate@binkert.org	sim/process.cc
3024762Snate@binkert.org	sim/syscall_emul.cc
3034762Snate@binkert.org        ''')
3044762Snate@binkert.org
3054382Sbinkertn@umich.edueio_sources = Split('''
3064762Snate@binkert.org	encumbered/eio/eio.cc
3074382Sbinkertn@umich.edu        ''')
3084762Snate@binkert.org
3094382Sbinkertn@umich.edumemtest_sources = Split('''
3104762Snate@binkert.org	cpu/memtest/memtest.cc
3114762Snate@binkert.org        ''')
3124762Snate@binkert.org
3134762Snate@binkert.orgtargetarch_files = Split('''
3144382Sbinkertn@umich.edu        alpha_common_syscall_emul.hh
3154382Sbinkertn@umich.edu        alpha_linux_process.hh
3164382Sbinkertn@umich.edu        alpha_memory.hh
3174382Sbinkertn@umich.edu        alpha_tru64_process.hh
3184382Sbinkertn@umich.edu        aout_machdep.h
3194382Sbinkertn@umich.edu        arguments.hh
3204762Snate@binkert.org        byte_swap.hh
3214382Sbinkertn@umich.edu        ecoff_machdep.h
3224382Sbinkertn@umich.edu        ev5.hh
3234382Sbinkertn@umich.edu        faults.hh
3244382Sbinkertn@umich.edu        isa_fullsys_traits.hh
3254762Snate@binkert.org        isa_traits.hh
3264762Snate@binkert.org        osfpal.hh
3274762Snate@binkert.org        pseudo_inst.hh
3284382Sbinkertn@umich.edu        stacktrace.hh
3295192Ssaidi@eecs.umich.edu        vptr.hh
3305192Ssaidi@eecs.umich.edu        vtophys.hh
3315192Ssaidi@eecs.umich.edu        ''')
3325192Ssaidi@eecs.umich.edu
3335192Ssaidi@eecs.umich.edufor f in targetarch_files:
3345192Ssaidi@eecs.umich.edu    env.Command('targetarch/' + f, 'arch/alpha/' + f,
3355192Ssaidi@eecs.umich.edu                '''echo '#include "arch/alpha/%s"' > $TARGET''' % f)
3365192Ssaidi@eecs.umich.edu
3375192Ssaidi@eecs.umich.edu
3384762Snate@binkert.org# Set up complete list of sources based on configuration.
3394382Sbinkertn@umich.edusources = base_sources + simple_cpu_sources
3404382Sbinkertn@umich.edu
3414382Sbinkertn@umich.eduif env['FULL_SYSTEM']:
3424762Snate@binkert.org    sources += full_system_sources
3434762Snate@binkert.org    if env['ALPHA_TLASER']:
3444382Sbinkertn@umich.edu        sources += turbolaser_sources
3454382Sbinkertn@umich.eduelse:
3464382Sbinkertn@umich.edu    sources += syscall_emulation_sources
3474762Snate@binkert.org
3484382Sbinkertn@umich.eduif env['USE_MYSQL']:
3494382Sbinkertn@umich.edu    sources += mysql_sources
3504762Snate@binkert.org
3514762Snate@binkert.orgfor opt in env.ExportOptions:
3524762Snate@binkert.org    env.ConfigFile(opt)
3534382Sbinkertn@umich.edu
3544382Sbinkertn@umich.edu###################################################
3554382Sbinkertn@umich.edu#
3564382Sbinkertn@umich.edu# Special build rules.
3574382Sbinkertn@umich.edu#
3584382Sbinkertn@umich.edu###################################################
3594382Sbinkertn@umich.edu
3604382Sbinkertn@umich.edu# base/traceflags.{cc,hh} are generated from base/traceflags.py.
3614382Sbinkertn@umich.edu# $TARGET.base will expand to "<build-dir>/base/traceflags".
3624382Sbinkertn@umich.eduenv.Command(Split('base/traceflags.hh base/traceflags.cc'),
363955SN/A            'base/traceflags.py',
364955SN/A            'python $SOURCE $TARGET.base')
365955SN/A
366955SN/A# several files are generated from arch/$TARGET_ISA/isa_desc.
3671108SN/Aenv.Command(Split('''arch/alpha/decoder.cc
368955SN/A		     arch/alpha/decoder.hh
369955SN/A                     arch/alpha/alpha_o3_exec.cc
370955SN/A		     arch/alpha/fast_cpu_exec.cc
371955SN/A                     arch/alpha/simple_cpu_exec.cc'''),
372955SN/A            Split('''arch/alpha/isa_desc
373955SN/A		     arch/isa_parser.py'''),
374955SN/A            '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha')
375955SN/A
376955SN/A
3772655Sstever@eecs.umich.edu# libelf build is described in its own SConscript file.
3782655Sstever@eecs.umich.edu# SConscript-local is the per-config build, which just copies some
3792655Sstever@eecs.umich.edu# header files into a place where they can be found.
3802655Sstever@eecs.umich.eduSConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
3812655Sstever@eecs.umich.eduSConscript('python/SConscript', exports = ['env'], duplicate=0)
3822655Sstever@eecs.umich.edu
3832655Sstever@eecs.umich.edu# This function adds the specified sources to the given build
3842655Sstever@eecs.umich.edu# environment, and returns a list of all the corresponding SCons
3852655Sstever@eecs.umich.edu# Object nodes (including an extra one for date.cc).  We explicitly
3862655Sstever@eecs.umich.edu# add the Object nodes so we can set up special dependencies for
3874762Snate@binkert.org# date.cc.
3882655Sstever@eecs.umich.edudef make_objs(sources, env):
3892655Sstever@eecs.umich.edu    objs = [env.Object(s) for s in sources]
3904007Ssaidi@eecs.umich.edu    # make date.cc depend on all other objects so it always gets
3914596Sbinkertn@umich.edu    # recompiled whenever anything else does
3924007Ssaidi@eecs.umich.edu    date_obj = env.Object('base/date.cc')
3934596Sbinkertn@umich.edu    env.Depends(date_obj, objs)
3944596Sbinkertn@umich.edu    objs.append(date_obj)
3952655Sstever@eecs.umich.edu    return objs
3964382Sbinkertn@umich.edu
3972655Sstever@eecs.umich.edu###################################################
3982655Sstever@eecs.umich.edu#
3992655Sstever@eecs.umich.edu# Define binaries.  Each different build type (debug, opt, etc.) gets
400955SN/A# a slightly different build environment.
4013918Ssaidi@eecs.umich.edu#
4023918Ssaidi@eecs.umich.edu###################################################
4033918Ssaidi@eecs.umich.edu
4043918Ssaidi@eecs.umich.edu# Include file paths are rooted in this directory.  SCons will
4053918Ssaidi@eecs.umich.edu# automatically expand '.' to refer to both the source directory and
4063918Ssaidi@eecs.umich.edu# the corresponding build directory to pick up generated include
4073918Ssaidi@eecs.umich.edu# files.
4083918Ssaidi@eecs.umich.eduenv.Append(CPPPATH='.')
4093918Ssaidi@eecs.umich.edu
4103918Ssaidi@eecs.umich.edu# Debug binary
4113918Ssaidi@eecs.umich.edudebugEnv = env.Copy(OBJSUFFIX='.do')
4123918Ssaidi@eecs.umich.edudebugEnv.Label = 'debug'
4133918Ssaidi@eecs.umich.edudebugEnv.Append(CCFLAGS=Split('-g -gstabs+ -O0'))
4143918Ssaidi@eecs.umich.edudebugEnv.Append(CPPDEFINES='DEBUG')
4153940Ssaidi@eecs.umich.edutlist = debugEnv.Program(target = 'm5.debug',
4163940Ssaidi@eecs.umich.edu                         source = make_objs(sources, debugEnv))
4173940Ssaidi@eecs.umich.edudebugEnv.M5Binary = tlist[0]
4183942Ssaidi@eecs.umich.edu
4193940Ssaidi@eecs.umich.edu# Optimized binary
4203515Ssaidi@eecs.umich.eduoptEnv = env.Copy()
4213918Ssaidi@eecs.umich.eduoptEnv.Label = 'opt'
4224762Snate@binkert.orgoptEnv.Append(CCFLAGS=Split('-g -O5'))
4233515Ssaidi@eecs.umich.edutlist = optEnv.Program(target = 'm5.opt',
4242655Sstever@eecs.umich.edu                       source = make_objs(sources, optEnv))
4253918Ssaidi@eecs.umich.eduoptEnv.M5Binary = tlist[0]
4263619Sbinkertn@umich.edu
427955SN/A# "Fast" binary
428955SN/AfastEnv = env.Copy(OBJSUFFIX='.fo')
4292655Sstever@eecs.umich.edufastEnv.Label = 'fast'
4303918Ssaidi@eecs.umich.edufastEnv.Append(CCFLAGS=Split('-O5'))
4313619Sbinkertn@umich.edufastEnv.Append(CPPDEFINES='NDEBUG')
432955SN/AfastEnv.Program(target = 'm5.fast.unstripped',
433955SN/A                source = make_objs(sources, fastEnv))
4342655Sstever@eecs.umich.edutlist = fastEnv.Command(target = 'm5.fast',
4353918Ssaidi@eecs.umich.edu                        source = 'm5.fast.unstripped',
4363619Sbinkertn@umich.edu                        action = 'strip $SOURCE -o $TARGET')
437955SN/AfastEnv.M5Binary = tlist[0]
438955SN/A
4392655Sstever@eecs.umich.edu# Profiled binary
4403918Ssaidi@eecs.umich.eduprofEnv = env.Copy(OBJSUFFIX='.po')
4413683Sstever@eecs.umich.eduprofEnv.Label = 'prof'
4422655Sstever@eecs.umich.eduprofEnv.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg')
4431869SN/Atlist = profEnv.Program(target = 'm5.prof',
4441869SN/A                        source = make_objs(sources, profEnv))
445profEnv.M5Binary = tlist[0]
446
447envList = [debugEnv, optEnv, fastEnv, profEnv]
448
449Return('envList')
450