SConscript revision 2253
110388SAndreas.Sandberg@ARM.com# -*- mode:python -*-
212114Ssascha.bischoff@arm.com
310388SAndreas.Sandberg@ARM.com# Copyright (c) 2004-2005 The Regents of The University of Michigan
410388SAndreas.Sandberg@ARM.com# All rights reserved.
510388SAndreas.Sandberg@ARM.com#
610388SAndreas.Sandberg@ARM.com# Redistribution and use in source and binary forms, with or without
710388SAndreas.Sandberg@ARM.com# modification, are permitted provided that the following conditions are
810388SAndreas.Sandberg@ARM.com# met: redistributions of source code must retain the above copyright
910388SAndreas.Sandberg@ARM.com# notice, this list of conditions and the following disclaimer;
1010388SAndreas.Sandberg@ARM.com# redistributions in binary form must reproduce the above copyright
1110388SAndreas.Sandberg@ARM.com# notice, this list of conditions and the following disclaimer in the
1210388SAndreas.Sandberg@ARM.com# documentation and/or other materials provided with the distribution;
1310388SAndreas.Sandberg@ARM.com# neither the name of the copyright holders nor the names of its
1410388SAndreas.Sandberg@ARM.com# contributors may be used to endorse or promote products derived from
1510388SAndreas.Sandberg@ARM.com# this software without specific prior written permission.
1610388SAndreas.Sandberg@ARM.com#
1710388SAndreas.Sandberg@ARM.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1810388SAndreas.Sandberg@ARM.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1910388SAndreas.Sandberg@ARM.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2010388SAndreas.Sandberg@ARM.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2110388SAndreas.Sandberg@ARM.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2210388SAndreas.Sandberg@ARM.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2310388SAndreas.Sandberg@ARM.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2410388SAndreas.Sandberg@ARM.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2510388SAndreas.Sandberg@ARM.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2610388SAndreas.Sandberg@ARM.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2710388SAndreas.Sandberg@ARM.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2810388SAndreas.Sandberg@ARM.com
2910388SAndreas.Sandberg@ARM.comimport os
3010388SAndreas.Sandberg@ARM.comimport sys
3110388SAndreas.Sandberg@ARM.comfrom os.path import isdir
3210388SAndreas.Sandberg@ARM.com
3310388SAndreas.Sandberg@ARM.com# This file defines how to build a particular configuration of M5
3410388SAndreas.Sandberg@ARM.com# based on variable settings in the 'env' build environment.
3510388SAndreas.Sandberg@ARM.com
3610388SAndreas.Sandberg@ARM.com# Import build environment variable from SConstruct.
3710388SAndreas.Sandberg@ARM.comImport('env')
3810388SAndreas.Sandberg@ARM.com
3910388SAndreas.Sandberg@ARM.com###################################################
4010388SAndreas.Sandberg@ARM.com#
4110388SAndreas.Sandberg@ARM.com# Define needed sources.
4210388SAndreas.Sandberg@ARM.com#
4310388SAndreas.Sandberg@ARM.com###################################################
4410388SAndreas.Sandberg@ARM.com
4510388SAndreas.Sandberg@ARM.com# Base sources used by all configurations.
4610388SAndreas.Sandberg@ARM.com
4710388SAndreas.Sandberg@ARM.combase_sources = Split('''
4810388SAndreas.Sandberg@ARM.com	base/circlebuf.cc
4910388SAndreas.Sandberg@ARM.com	base/copyright.cc
5010388SAndreas.Sandberg@ARM.com	base/cprintf.cc
5111931Sandreas.sandberg@arm.com        base/embedfile.cc
5211931Sandreas.sandberg@arm.com	base/fast_alloc.cc
5310388SAndreas.Sandberg@ARM.com	base/fifo_buffer.cc
5410388SAndreas.Sandberg@ARM.com	base/hostinfo.cc
5510388SAndreas.Sandberg@ARM.com	base/hybrid_pred.cc
5610388SAndreas.Sandberg@ARM.com	base/inifile.cc
5710388SAndreas.Sandberg@ARM.com	base/intmath.cc
5810388SAndreas.Sandberg@ARM.com	base/match.cc
5910388SAndreas.Sandberg@ARM.com	base/misc.cc
6010388SAndreas.Sandberg@ARM.com	base/output.cc
6110388SAndreas.Sandberg@ARM.com	base/pollevent.cc
6210388SAndreas.Sandberg@ARM.com	base/range.cc
6310388SAndreas.Sandberg@ARM.com	base/random.cc
6410388SAndreas.Sandberg@ARM.com	base/sat_counter.cc
6510388SAndreas.Sandberg@ARM.com	base/socket.cc
6610388SAndreas.Sandberg@ARM.com	base/statistics.cc
6710388SAndreas.Sandberg@ARM.com	base/str.cc
6810388SAndreas.Sandberg@ARM.com	base/time.cc
6910388SAndreas.Sandberg@ARM.com	base/trace.cc
7010388SAndreas.Sandberg@ARM.com	base/traceflags.cc
7110388SAndreas.Sandberg@ARM.com	base/userinfo.cc
7210388SAndreas.Sandberg@ARM.com	base/compression/lzss_compression.cc
7310388SAndreas.Sandberg@ARM.com	base/loader/aout_object.cc
7410388SAndreas.Sandberg@ARM.com	base/loader/ecoff_object.cc
7510388SAndreas.Sandberg@ARM.com	base/loader/elf_object.cc
7610388SAndreas.Sandberg@ARM.com	base/loader/object_file.cc
7710388SAndreas.Sandberg@ARM.com	base/loader/symtab.cc
7810388SAndreas.Sandberg@ARM.com	base/stats/events.cc
7910388SAndreas.Sandberg@ARM.com	base/stats/statdb.cc
8010388SAndreas.Sandberg@ARM.com	base/stats/visit.cc
8110388SAndreas.Sandberg@ARM.com	base/stats/text.cc
8210388SAndreas.Sandberg@ARM.com
8310388SAndreas.Sandberg@ARM.com	cpu/base.cc
8410388SAndreas.Sandberg@ARM.com        cpu/base_dyn_inst.cc
8510388SAndreas.Sandberg@ARM.com	cpu/cpu_exec_context.cc
8610388SAndreas.Sandberg@ARM.com	cpu/exetrace.cc
8710388SAndreas.Sandberg@ARM.com	cpu/pc_event.cc
8810388SAndreas.Sandberg@ARM.com	cpu/static_inst.cc
8910388SAndreas.Sandberg@ARM.com        cpu/sampler/sampler.cc
9010388SAndreas.Sandberg@ARM.com        cpu/trace/reader/mem_trace_reader.cc
9110388SAndreas.Sandberg@ARM.com        cpu/trace/reader/ibm_reader.cc
9210388SAndreas.Sandberg@ARM.com        cpu/trace/reader/itx_reader.cc
9310388SAndreas.Sandberg@ARM.com        cpu/trace/reader/m5_reader.cc
9410388SAndreas.Sandberg@ARM.com        cpu/trace/opt_cpu.cc
9510388SAndreas.Sandberg@ARM.com        cpu/trace/trace_cpu.cc
9610388SAndreas.Sandberg@ARM.com
9710388SAndreas.Sandberg@ARM.com	encumbered/mem/functional/main.cc
9810388SAndreas.Sandberg@ARM.com
9910388SAndreas.Sandberg@ARM.com	mem/base_hier.cc
10010388SAndreas.Sandberg@ARM.com	mem/base_mem.cc
10110388SAndreas.Sandberg@ARM.com	mem/hier_params.cc
10210388SAndreas.Sandberg@ARM.com	mem/mem_cmd.cc
10310388SAndreas.Sandberg@ARM.com	mem/mem_debug.cc
10410388SAndreas.Sandberg@ARM.com	mem/mem_req.cc
10510388SAndreas.Sandberg@ARM.com	mem/memory_interface.cc
10610388SAndreas.Sandberg@ARM.com	mem/bus/base_interface.cc
10710388SAndreas.Sandberg@ARM.com	mem/bus/bus.cc
10810388SAndreas.Sandberg@ARM.com	mem/bus/bus_bridge.cc
10910388SAndreas.Sandberg@ARM.com	mem/bus/bus_bridge_master.cc
11010388SAndreas.Sandberg@ARM.com	mem/bus/bus_bridge_slave.cc
11110388SAndreas.Sandberg@ARM.com	mem/bus/bus_interface.cc
11210388SAndreas.Sandberg@ARM.com	mem/bus/dma_bus_interface.cc
11310388SAndreas.Sandberg@ARM.com	mem/bus/dma_interface.cc
11410388SAndreas.Sandberg@ARM.com	mem/bus/master_interface.cc
11510388SAndreas.Sandberg@ARM.com	mem/bus/slave_interface.cc
11610388SAndreas.Sandberg@ARM.com	mem/cache/base_cache.cc
11710388SAndreas.Sandberg@ARM.com	mem/cache/cache.cc
11810388SAndreas.Sandberg@ARM.com	mem/cache/cache_builder.cc
11910388SAndreas.Sandberg@ARM.com	mem/cache/coherence/coherence_protocol.cc
12010388SAndreas.Sandberg@ARM.com	mem/cache/coherence/uni_coherence.cc
12110388SAndreas.Sandberg@ARM.com	mem/cache/miss/blocking_buffer.cc
12210388SAndreas.Sandberg@ARM.com	mem/cache/miss/miss_queue.cc
12310388SAndreas.Sandberg@ARM.com	mem/cache/miss/mshr.cc
12410388SAndreas.Sandberg@ARM.com	mem/cache/miss/mshr_queue.cc
12510388SAndreas.Sandberg@ARM.com        mem/cache/prefetch/base_prefetcher.cc
12610388SAndreas.Sandberg@ARM.com        mem/cache/prefetch/prefetcher.cc
12710388SAndreas.Sandberg@ARM.com        mem/cache/prefetch/tagged_prefetcher.cc
12810388SAndreas.Sandberg@ARM.com	mem/cache/tags/base_tags.cc
12910388SAndreas.Sandberg@ARM.com	mem/cache/tags/cache_tags.cc	
13010388SAndreas.Sandberg@ARM.com	mem/cache/tags/fa_lru.cc
13110388SAndreas.Sandberg@ARM.com	mem/cache/tags/iic.cc
13210388SAndreas.Sandberg@ARM.com	mem/cache/tags/lru.cc
13310388SAndreas.Sandberg@ARM.com	mem/cache/tags/repl/gen.cc
13410388SAndreas.Sandberg@ARM.com	mem/cache/tags/repl/repl.cc
13510388SAndreas.Sandberg@ARM.com	mem/cache/tags/split.cc
13610388SAndreas.Sandberg@ARM.com	mem/cache/tags/split_lru.cc
13710388SAndreas.Sandberg@ARM.com	mem/cache/tags/split_lifo.cc
13810388SAndreas.Sandberg@ARM.com	mem/functional/functional.cc
13910388SAndreas.Sandberg@ARM.com	mem/timing/base_memory.cc
14010388SAndreas.Sandberg@ARM.com	mem/timing/memory_builder.cc
14110388SAndreas.Sandberg@ARM.com	mem/timing/simple_mem_bank.cc
14210388SAndreas.Sandberg@ARM.com        mem/trace/itx_writer.cc
14310388SAndreas.Sandberg@ARM.com	mem/trace/mem_trace_writer.cc
14410388SAndreas.Sandberg@ARM.com	mem/trace/m5_writer.cc
14510388SAndreas.Sandberg@ARM.com
14610388SAndreas.Sandberg@ARM.com        python/pyconfig.cc
14710388SAndreas.Sandberg@ARM.com        python/embedded_py.cc
14810388SAndreas.Sandberg@ARM.com
14910388SAndreas.Sandberg@ARM.com	sim/builder.cc
15010388SAndreas.Sandberg@ARM.com	sim/configfile.cc
15110388SAndreas.Sandberg@ARM.com	sim/debug.cc
15210388SAndreas.Sandberg@ARM.com	sim/eventq.cc
15310388SAndreas.Sandberg@ARM.com	sim/faults.cc
15410388SAndreas.Sandberg@ARM.com	sim/main.cc
15510388SAndreas.Sandberg@ARM.com	sim/param.cc
15610388SAndreas.Sandberg@ARM.com	sim/profile.cc
15710388SAndreas.Sandberg@ARM.com	sim/root.cc
15810388SAndreas.Sandberg@ARM.com	sim/serialize.cc
15910388SAndreas.Sandberg@ARM.com	sim/sim_events.cc
16010388SAndreas.Sandberg@ARM.com	sim/sim_exit.cc
16110388SAndreas.Sandberg@ARM.com	sim/sim_object.cc
16210388SAndreas.Sandberg@ARM.com	sim/startup.cc
16310388SAndreas.Sandberg@ARM.com	sim/stat_context.cc
16410388SAndreas.Sandberg@ARM.com	sim/stat_control.cc
16510388SAndreas.Sandberg@ARM.com	sim/trace_context.cc
16610388SAndreas.Sandberg@ARM.com        ''')
16710388SAndreas.Sandberg@ARM.com
16810388SAndreas.Sandberg@ARM.com# Old FullCPU sources
16910388SAndreas.Sandberg@ARM.comfull_cpu_sources = Split('''
17010388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/bpred.cc
17110388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/commit.cc
17210388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/cpu.cc
17310388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/create_vector.cc
17410388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/cv_spec_state.cc
17510388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/dd_queue.cc
17610388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/dep_link.cc
17710388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/dispatch.cc
17810388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/dyn_inst.cc
17910388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/execute.cc
18010388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/fetch.cc
18110388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/floss_reasons.cc
18210388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/fu_pool.cc
18310388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/inst_fifo.cc
18410388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/instpipe.cc
18510388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/issue.cc
18610388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/ls_queue.cc
18710388SAndreas.Sandberg@ARM.com	encumbered/cpu/full/machine_queue.cc
18810388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/pipetrace.cc
18910388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/readyq.cc
19010388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/reg_info.cc
19110388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/rob_station.cc
19210388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/spec_memory.cc
19310388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/spec_state.cc
19410388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/storebuffer.cc
19510388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/writeback.cc
19610388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/iq/iq_station.cc
19710388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/iq/iqueue.cc
19810388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/iq/segmented/chain_info.cc
19910388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/iq/segmented/chain_wire.cc
20010388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/iq/segmented/iq_seg.cc
20110388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/iq/segmented/iq_segmented.cc
20210388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/iq/segmented/seg_chain.cc
20310388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/iq/seznec/iq_seznec.cc
20410388SAndreas.Sandberg@ARM.com        encumbered/cpu/full/iq/standard/iq_standard.cc
20510388SAndreas.Sandberg@ARM.com        ''')
20610388SAndreas.Sandberg@ARM.com
20710388SAndreas.Sandberg@ARM.com# MySql sources
20810388SAndreas.Sandberg@ARM.commysql_sources = Split('''
20910388SAndreas.Sandberg@ARM.com	base/mysql.cc
21010388SAndreas.Sandberg@ARM.com	base/stats/mysql.cc
21110388SAndreas.Sandberg@ARM.com        ''')
21210388SAndreas.Sandberg@ARM.com
21310388SAndreas.Sandberg@ARM.com# Full-system sources
21410388SAndreas.Sandberg@ARM.comfull_system_sources = Split('''
21510388SAndreas.Sandberg@ARM.com	base/crc.cc
21610388SAndreas.Sandberg@ARM.com	base/inet.cc
21710388SAndreas.Sandberg@ARM.com	base/remote_gdb.cc
21810388SAndreas.Sandberg@ARM.com
21910388SAndreas.Sandberg@ARM.com	cpu/intr_control.cc
22010388SAndreas.Sandberg@ARM.com        cpu/profile.cc
22110388SAndreas.Sandberg@ARM.com
22210388SAndreas.Sandberg@ARM.com	dev/alpha_console.cc
22310388SAndreas.Sandberg@ARM.com	dev/baddev.cc
22410388SAndreas.Sandberg@ARM.com        dev/simconsole.cc
22510388SAndreas.Sandberg@ARM.com	dev/disk_image.cc
22610388SAndreas.Sandberg@ARM.com	dev/etherbus.cc
22710388SAndreas.Sandberg@ARM.com	dev/etherdump.cc
22810388SAndreas.Sandberg@ARM.com	dev/etherint.cc
22910388SAndreas.Sandberg@ARM.com	dev/etherlink.cc
23010388SAndreas.Sandberg@ARM.com	dev/etherpkt.cc
23110388SAndreas.Sandberg@ARM.com	dev/ethertap.cc
23210388SAndreas.Sandberg@ARM.com	dev/ide_ctrl.cc
23310388SAndreas.Sandberg@ARM.com	dev/ide_disk.cc
23410388SAndreas.Sandberg@ARM.com	dev/io_device.cc
23510388SAndreas.Sandberg@ARM.com	dev/ns_gige.cc
23610388SAndreas.Sandberg@ARM.com	dev/pciconfigall.cc
23710388SAndreas.Sandberg@ARM.com	dev/pcidev.cc
23810388SAndreas.Sandberg@ARM.com	dev/pcifake.cc
23910388SAndreas.Sandberg@ARM.com	dev/pktfifo.cc
24010388SAndreas.Sandberg@ARM.com	dev/platform.cc
24110388SAndreas.Sandberg@ARM.com	dev/sinic.cc
24210388SAndreas.Sandberg@ARM.com	dev/simple_disk.cc
24310388SAndreas.Sandberg@ARM.com	dev/tsunami.cc
24410388SAndreas.Sandberg@ARM.com	dev/tsunami_cchip.cc
24510388SAndreas.Sandberg@ARM.com	dev/isa_fake.cc
24610388SAndreas.Sandberg@ARM.com	dev/tsunami_io.cc
24710388SAndreas.Sandberg@ARM.com	dev/tsunami_pchip.cc
24810388SAndreas.Sandberg@ARM.com	dev/uart.cc
24910388SAndreas.Sandberg@ARM.com	dev/uart8250.cc
25010388SAndreas.Sandberg@ARM.com
25110388SAndreas.Sandberg@ARM.com	kern/kernel_binning.cc
25210388SAndreas.Sandberg@ARM.com	kern/kernel_stats.cc
25310388SAndreas.Sandberg@ARM.com	kern/system_events.cc
25410388SAndreas.Sandberg@ARM.com	kern/linux/events.cc
25510388SAndreas.Sandberg@ARM.com	kern/linux/linux_syscalls.cc
25610388SAndreas.Sandberg@ARM.com	kern/linux/printk.cc
25710388SAndreas.Sandberg@ARM.com	kern/tru64/dump_mbuf.cc
25810388SAndreas.Sandberg@ARM.com	kern/tru64/printf.cc
25910388SAndreas.Sandberg@ARM.com	kern/tru64/tru64_events.cc
26010388SAndreas.Sandberg@ARM.com	kern/tru64/tru64_syscalls.cc
26110388SAndreas.Sandberg@ARM.com
26210388SAndreas.Sandberg@ARM.com	mem/functional/memory_control.cc
26310388SAndreas.Sandberg@ARM.com	mem/functional/physical.cc
26410388SAndreas.Sandberg@ARM.com
26510388SAndreas.Sandberg@ARM.com	sim/system.cc
26610388SAndreas.Sandberg@ARM.com	sim/pseudo_inst.cc
26710388SAndreas.Sandberg@ARM.com        ''')
26810388SAndreas.Sandberg@ARM.com
26910388SAndreas.Sandberg@ARM.com# turbolaser encumbered sources
27010388SAndreas.Sandberg@ARM.comturbolaser_sources = Split('''
27110388SAndreas.Sandberg@ARM.com	encumbered/dev/dma.cc
27210388SAndreas.Sandberg@ARM.com	encumbered/dev/etherdev.cc
27310388SAndreas.Sandberg@ARM.com	encumbered/dev/scsi.cc
27410388SAndreas.Sandberg@ARM.com	encumbered/dev/scsi_ctrl.cc
27510388SAndreas.Sandberg@ARM.com	encumbered/dev/scsi_disk.cc
27610388SAndreas.Sandberg@ARM.com	encumbered/dev/scsi_none.cc
27710388SAndreas.Sandberg@ARM.com	encumbered/dev/tlaser_clock.cc
27810388SAndreas.Sandberg@ARM.com	encumbered/dev/tlaser_ipi.cc
27910388SAndreas.Sandberg@ARM.com	encumbered/dev/tlaser_mbox.cc
28010388SAndreas.Sandberg@ARM.com	encumbered/dev/tlaser_mc146818.cc
28110388SAndreas.Sandberg@ARM.com	encumbered/dev/tlaser_node.cc
28210388SAndreas.Sandberg@ARM.com	encumbered/dev/tlaser_pcia.cc
28310388SAndreas.Sandberg@ARM.com	encumbered/dev/tlaser_pcidev.cc
28410388SAndreas.Sandberg@ARM.com	encumbered/dev/tlaser_serial.cc
28510388SAndreas.Sandberg@ARM.com	encumbered/dev/turbolaser.cc
28610388SAndreas.Sandberg@ARM.com	encumbered/dev/uart8530.cc
28710388SAndreas.Sandberg@ARM.com        ''')
28810388SAndreas.Sandberg@ARM.com
28910388SAndreas.Sandberg@ARM.com# Syscall emulation (non-full-system) sources
29010388SAndreas.Sandberg@ARM.comsyscall_emulation_sources = Split('''
29110388SAndreas.Sandberg@ARM.com	cpu/memtest/memtest.cc
29210388SAndreas.Sandberg@ARM.com	encumbered/eio/eio.cc
29310388SAndreas.Sandberg@ARM.com	encumbered/eio/exolex.cc
29410388SAndreas.Sandberg@ARM.com	encumbered/eio/libexo.cc
29510388SAndreas.Sandberg@ARM.com        kern/linux/linux.cc
29610388SAndreas.Sandberg@ARM.com        kern/tru64/tru64.cc
29710388SAndreas.Sandberg@ARM.com	sim/process.cc
29810388SAndreas.Sandberg@ARM.com	sim/syscall_emul.cc
29910388SAndreas.Sandberg@ARM.com        ''')
30010388SAndreas.Sandberg@ARM.com
30110388SAndreas.Sandberg@ARM.com# Add a flag defining what THE_ISA should be for all compilation
30210388SAndreas.Sandberg@ARM.comenv.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())])
30310388SAndreas.Sandberg@ARM.com
30410388SAndreas.Sandberg@ARM.comarch_sources = SConscript('arch/SConscript',
30510388SAndreas.Sandberg@ARM.com                          exports = 'env', duplicate = False)
30610388SAndreas.Sandberg@ARM.com
30710388SAndreas.Sandberg@ARM.comcpu_sources = SConscript('cpu/SConscript',
30810388SAndreas.Sandberg@ARM.com                         exports = 'env', duplicate = False)
30910388SAndreas.Sandberg@ARM.com
31010388SAndreas.Sandberg@ARM.com# This is outside of cpu/SConscript since the source directory isn't
31110388SAndreas.Sandberg@ARM.com# underneath 'cpu'.
31210388SAndreas.Sandberg@ARM.comif 'FullCPU' in env['CPU_MODELS']:
31310388SAndreas.Sandberg@ARM.com    cpu_sources += full_cpu_sources
31410388SAndreas.Sandberg@ARM.com
31510388SAndreas.Sandberg@ARM.com# Set up complete list of sources based on configuration.
31610388SAndreas.Sandberg@ARM.comsources = base_sources + arch_sources + cpu_sources
31710905Sandreas.sandberg@arm.com
31810388SAndreas.Sandberg@ARM.comif env['FULL_SYSTEM']:
31910388SAndreas.Sandberg@ARM.com    sources += full_system_sources
32010388SAndreas.Sandberg@ARM.com    if env['ALPHA_TLASER']:
32110388SAndreas.Sandberg@ARM.com        sources += turbolaser_sources
32210388SAndreas.Sandberg@ARM.comelse:
32310388SAndreas.Sandberg@ARM.com    sources += syscall_emulation_sources
32411168Sandreas.hansson@arm.com
32511168Sandreas.hansson@arm.comif env['USE_MYSQL']:
32610388SAndreas.Sandberg@ARM.com    sources += mysql_sources
32710388SAndreas.Sandberg@ARM.com
32810388SAndreas.Sandberg@ARM.comfor opt in env.ExportOptions:
32910388SAndreas.Sandberg@ARM.com    env.ConfigFile(opt)
33010388SAndreas.Sandberg@ARM.com
33110388SAndreas.Sandberg@ARM.com###################################################
33210388SAndreas.Sandberg@ARM.com#
33310388SAndreas.Sandberg@ARM.com# Special build rules.
33410388SAndreas.Sandberg@ARM.com#
33510388SAndreas.Sandberg@ARM.com###################################################
33610388SAndreas.Sandberg@ARM.com
33710388SAndreas.Sandberg@ARM.com# base/traceflags.{cc,hh} are generated from base/traceflags.py.
33810388SAndreas.Sandberg@ARM.com# $TARGET.base will expand to "<build-dir>/base/traceflags".
33910388SAndreas.Sandberg@ARM.comenv.Command(Split('base/traceflags.hh base/traceflags.cc'),
34010388SAndreas.Sandberg@ARM.com            'base/traceflags.py',
34110388SAndreas.Sandberg@ARM.com            'python $SOURCE $TARGET.base')
34210388SAndreas.Sandberg@ARM.com
34310388SAndreas.Sandberg@ARM.com# libelf build is described in its own SConscript file.
34410388SAndreas.Sandberg@ARM.com# SConscript-local is the per-config build, which just copies some
34510388SAndreas.Sandberg@ARM.com# header files into a place where they can be found.
34610388SAndreas.Sandberg@ARM.comSConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
34710388SAndreas.Sandberg@ARM.comSConscript('python/SConscript', exports = ['env'], duplicate=0)
34810388SAndreas.Sandberg@ARM.com
34910388SAndreas.Sandberg@ARM.com# This function adds the specified sources to the given build
35010388SAndreas.Sandberg@ARM.com# environment, and returns a list of all the corresponding SCons
35110388SAndreas.Sandberg@ARM.com# Object nodes (including an extra one for date.cc).  We explicitly
35210388SAndreas.Sandberg@ARM.com# add the Object nodes so we can set up special dependencies for
35310388SAndreas.Sandberg@ARM.com# date.cc.
35410388SAndreas.Sandberg@ARM.comdef make_objs(sources, env):
35510388SAndreas.Sandberg@ARM.com    objs = [env.Object(s) for s in sources]
35610388SAndreas.Sandberg@ARM.com    # make date.cc depend on all other objects so it always gets
35710388SAndreas.Sandberg@ARM.com    # recompiled whenever anything else does
35810388SAndreas.Sandberg@ARM.com    date_obj = env.Object('base/date.cc')
35910388SAndreas.Sandberg@ARM.com    env.Depends(date_obj, objs)
36010388SAndreas.Sandberg@ARM.com    objs.append(date_obj)
36110388SAndreas.Sandberg@ARM.com    return objs
36210388SAndreas.Sandberg@ARM.com
36310388SAndreas.Sandberg@ARM.com###################################################
36410388SAndreas.Sandberg@ARM.com#
36510388SAndreas.Sandberg@ARM.com# Define binaries.  Each different build type (debug, opt, etc.) gets
36610388SAndreas.Sandberg@ARM.com# a slightly different build environment.
36710388SAndreas.Sandberg@ARM.com#
36810388SAndreas.Sandberg@ARM.com###################################################
36910388SAndreas.Sandberg@ARM.com
37010388SAndreas.Sandberg@ARM.com# Include file paths are rooted in this directory.  SCons will
37110388SAndreas.Sandberg@ARM.com# automatically expand '.' to refer to both the source directory and
37210388SAndreas.Sandberg@ARM.com# the corresponding build directory to pick up generated include
37310388SAndreas.Sandberg@ARM.com# files.
37410388SAndreas.Sandberg@ARM.comenv.Append(CPPPATH='.')
37510388SAndreas.Sandberg@ARM.comenv.Append(CPPPATH='./libelf')
37610388SAndreas.Sandberg@ARM.com
37710388SAndreas.Sandberg@ARM.com# Debug binary
37810388SAndreas.Sandberg@ARM.comdebugEnv = env.Copy(OBJSUFFIX='.do')
37910388SAndreas.Sandberg@ARM.comdebugEnv.Label = 'debug'
38010388SAndreas.Sandberg@ARM.comdebugEnv.Append(CCFLAGS=Split('-g -gstabs+ -O0'))
38110388SAndreas.Sandberg@ARM.comdebugEnv.Append(CPPDEFINES='DEBUG')
38210388SAndreas.Sandberg@ARM.comtlist = debugEnv.Program(target = 'm5.debug',
38310388SAndreas.Sandberg@ARM.com                         source = make_objs(sources, debugEnv))
38410388SAndreas.Sandberg@ARM.comdebugEnv.M5Binary = tlist[0]
38510388SAndreas.Sandberg@ARM.com
38610388SAndreas.Sandberg@ARM.com# Optimized binary
38710388SAndreas.Sandberg@ARM.comoptEnv = env.Copy()
38810388SAndreas.Sandberg@ARM.comoptEnv.Label = 'opt'
38910388SAndreas.Sandberg@ARM.comoptEnv.Append(CCFLAGS=Split('-g -O5'))
39010388SAndreas.Sandberg@ARM.comtlist = optEnv.Program(target = 'm5.opt',
39110388SAndreas.Sandberg@ARM.com                       source = make_objs(sources, optEnv))
39210388SAndreas.Sandberg@ARM.comoptEnv.M5Binary = tlist[0]
39310388SAndreas.Sandberg@ARM.com
39410388SAndreas.Sandberg@ARM.com# "Fast" binary
39510388SAndreas.Sandberg@ARM.comfastEnv = env.Copy(OBJSUFFIX='.fo')
39610388SAndreas.Sandberg@ARM.comfastEnv.Label = 'fast'
39710388SAndreas.Sandberg@ARM.comfastEnv.Append(CCFLAGS=Split('-O5'))
39810388SAndreas.Sandberg@ARM.comfastEnv.Append(CPPDEFINES='NDEBUG')
39910388SAndreas.Sandberg@ARM.comfastEnv.Program(target = 'm5.fast.unstripped',
40010388SAndreas.Sandberg@ARM.com                source = make_objs(sources, fastEnv))
40110388SAndreas.Sandberg@ARM.comtlist = fastEnv.Command(target = 'm5.fast',
40210388SAndreas.Sandberg@ARM.com                        source = 'm5.fast.unstripped',
40310388SAndreas.Sandberg@ARM.com                        action = 'strip $SOURCE -o $TARGET')
40410388SAndreas.Sandberg@ARM.comfastEnv.M5Binary = tlist[0]
40510388SAndreas.Sandberg@ARM.com
40610388SAndreas.Sandberg@ARM.com# Profiled binary
40710388SAndreas.Sandberg@ARM.comprofEnv = env.Copy(OBJSUFFIX='.po')
40810388SAndreas.Sandberg@ARM.comprofEnv.Label = 'prof'
40910388SAndreas.Sandberg@ARM.comprofEnv.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg')
41010388SAndreas.Sandberg@ARM.comtlist = profEnv.Program(target = 'm5.prof',
41110388SAndreas.Sandberg@ARM.com                        source = make_objs(sources, profEnv))
41210388SAndreas.Sandberg@ARM.comprofEnv.M5Binary = tlist[0]
41310388SAndreas.Sandberg@ARM.com
41410388SAndreas.Sandberg@ARM.comenvList = [debugEnv, optEnv, fastEnv, profEnv]
41510388SAndreas.Sandberg@ARM.com
41610388SAndreas.Sandberg@ARM.comReturn('envList')
41710388SAndreas.Sandberg@ARM.com