SConscript revision 2170
14120Sgblack@eecs.umich.edu# -*- mode:python -*-
24120Sgblack@eecs.umich.edu
37087Snate@binkert.org# Copyright (c) 2004-2005 The Regents of The University of Michigan
47087Snate@binkert.org# All rights reserved.
57087Snate@binkert.org#
67087Snate@binkert.org# Redistribution and use in source and binary forms, with or without
77087Snate@binkert.org# modification, are permitted provided that the following conditions are
87087Snate@binkert.org# met: redistributions of source code must retain the above copyright
97087Snate@binkert.org# notice, this list of conditions and the following disclaimer;
107087Snate@binkert.org# redistributions in binary form must reproduce the above copyright
117087Snate@binkert.org# notice, this list of conditions and the following disclaimer in the
127087Snate@binkert.org# documentation and/or other materials provided with the distribution;
137087Snate@binkert.org# neither the name of the copyright holders nor the names of its
147087Snate@binkert.org# contributors may be used to endorse or promote products derived from
154120Sgblack@eecs.umich.edu# this software without specific prior written permission.
164120Sgblack@eecs.umich.edu#
174120Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
184120Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
194120Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
204120Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
214120Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
224120Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
234120Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
244120Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
254120Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
264120Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
274120Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
284120Sgblack@eecs.umich.edu
294120Sgblack@eecs.umich.eduimport os
304120Sgblack@eecs.umich.eduimport sys
314120Sgblack@eecs.umich.edufrom os.path import isdir
324120Sgblack@eecs.umich.edu
334120Sgblack@eecs.umich.edu# This file defines how to build a particular configuration of M5
344120Sgblack@eecs.umich.edu# based on variable settings in the 'env' build environment.
354120Sgblack@eecs.umich.edu
364120Sgblack@eecs.umich.edu# Import build environment variable from SConstruct.
374120Sgblack@eecs.umich.eduImport('env')
384120Sgblack@eecs.umich.edu
394120Sgblack@eecs.umich.edu###################################################
404120Sgblack@eecs.umich.edu#
414120Sgblack@eecs.umich.edu# Define needed sources.
424120Sgblack@eecs.umich.edu#
434202Sbinkertn@umich.edu###################################################
445069Sgblack@eecs.umich.edu
454202Sbinkertn@umich.edu# Base sources used by all configurations.
465659Sgblack@eecs.umich.edu
479022Sgblack@eecs.umich.edubase_sources = Split('''
489023Sgblack@eecs.umich.edu	base/circlebuf.cc
494601Sgblack@eecs.umich.edu	base/copyright.cc
505124Sgblack@eecs.umich.edu	base/cprintf.cc
517966Sgblack@eecs.umich.edu        base/embedfile.cc
525083Sgblack@eecs.umich.edu	base/fast_alloc.cc
534679Sgblack@eecs.umich.edu	base/fifo_buffer.cc
546515Sgblack@eecs.umich.edu	base/hostinfo.cc
555083Sgblack@eecs.umich.edu	base/hybrid_pred.cc
564679Sgblack@eecs.umich.edu	base/inifile.cc
574679Sgblack@eecs.umich.edu	base/intmath.cc
588745Sgblack@eecs.umich.edu	base/match.cc
596313Sgblack@eecs.umich.edu	base/misc.cc
608771Sgblack@eecs.umich.edu	base/output.cc
618771Sgblack@eecs.umich.edu	base/pollevent.cc
628771Sgblack@eecs.umich.edu	base/range.cc
636365Sgblack@eecs.umich.edu	base/random.cc
645124Sgblack@eecs.umich.edu	base/sat_counter.cc
658752Sgblack@eecs.umich.edu	base/socket.cc
668771Sgblack@eecs.umich.edu	base/statistics.cc
6710553Salexandru.dutu@amd.com	base/str.cc
684202Sbinkertn@umich.edu	base/time.cc
698771Sgblack@eecs.umich.edu	base/trace.cc
708771Sgblack@eecs.umich.edu	base/traceflags.cc
714997Sgblack@eecs.umich.edu	base/userinfo.cc
727624Sgblack@eecs.umich.edu	base/compression/lzss_compression.cc
735135Sgblack@eecs.umich.edu	base/loader/aout_object.cc
748753Sgblack@eecs.umich.edu	base/loader/ecoff_object.cc
754997Sgblack@eecs.umich.edu	base/loader/elf_object.cc
769384SAndreas.Sandberg@arm.com	base/loader/object_file.cc
778745Sgblack@eecs.umich.edu	base/loader/symtab.cc
786365Sgblack@eecs.umich.edu	base/stats/events.cc
798771Sgblack@eecs.umich.edu	base/stats/statdb.cc
808740Sgblack@eecs.umich.edu	base/stats/visit.cc
816365Sgblack@eecs.umich.edu	base/stats/text.cc
828740Sgblack@eecs.umich.edu
838745Sgblack@eecs.umich.edu	cpu/base.cc
848752Sgblack@eecs.umich.edu        cpu/base_dyn_inst.cc
858752Sgblack@eecs.umich.edu	cpu/exec_context.cc
869023Sgblack@eecs.umich.edu	cpu/exetrace.cc
878335Snate@binkert.org	cpu/pc_event.cc
884120Sgblack@eecs.umich.edu	cpu/static_inst.cc
895069Sgblack@eecs.umich.edu        cpu/sampler/sampler.cc
905081Sgblack@eecs.umich.edu        cpu/trace/reader/mem_trace_reader.cc
915081Sgblack@eecs.umich.edu        cpu/trace/reader/ibm_reader.cc
925081Sgblack@eecs.umich.edu        cpu/trace/reader/itx_reader.cc
935081Sgblack@eecs.umich.edu        cpu/trace/reader/m5_reader.cc
945081Sgblack@eecs.umich.edu        cpu/trace/opt_cpu.cc
955081Sgblack@eecs.umich.edu        cpu/trace/trace_cpu.cc
965081Sgblack@eecs.umich.edu
975081Sgblack@eecs.umich.edu	encumbered/mem/functional/main.cc
985081Sgblack@eecs.umich.edu
995081Sgblack@eecs.umich.edu	mem/base_hier.cc
1005081Sgblack@eecs.umich.edu	mem/base_mem.cc
1015081Sgblack@eecs.umich.edu	mem/hier_params.cc
1025081Sgblack@eecs.umich.edu	mem/mem_cmd.cc
1035081Sgblack@eecs.umich.edu	mem/mem_debug.cc
1045081Sgblack@eecs.umich.edu	mem/mem_req.cc
1055081Sgblack@eecs.umich.edu	mem/memory_interface.cc
1065081Sgblack@eecs.umich.edu	mem/bus/base_interface.cc
1075081Sgblack@eecs.umich.edu	mem/bus/bus.cc
1085081Sgblack@eecs.umich.edu	mem/bus/bus_bridge.cc
1095081Sgblack@eecs.umich.edu	mem/bus/bus_bridge_master.cc
1105081Sgblack@eecs.umich.edu	mem/bus/bus_bridge_slave.cc
1115081Sgblack@eecs.umich.edu	mem/bus/bus_interface.cc
1125081Sgblack@eecs.umich.edu	mem/bus/dma_bus_interface.cc
1135081Sgblack@eecs.umich.edu	mem/bus/dma_interface.cc
1145081Sgblack@eecs.umich.edu	mem/bus/master_interface.cc
1155081Sgblack@eecs.umich.edu	mem/bus/slave_interface.cc
1165081Sgblack@eecs.umich.edu	mem/cache/base_cache.cc
1175081Sgblack@eecs.umich.edu	mem/cache/cache.cc
1185081Sgblack@eecs.umich.edu	mem/cache/cache_builder.cc
1195081Sgblack@eecs.umich.edu	mem/cache/coherence/coherence_protocol.cc
1205081Sgblack@eecs.umich.edu	mem/cache/coherence/uni_coherence.cc
1215081Sgblack@eecs.umich.edu	mem/cache/miss/blocking_buffer.cc
1225081Sgblack@eecs.umich.edu	mem/cache/miss/miss_queue.cc
1235081Sgblack@eecs.umich.edu	mem/cache/miss/mshr.cc
1245081Sgblack@eecs.umich.edu	mem/cache/miss/mshr_queue.cc
1255081Sgblack@eecs.umich.edu        mem/cache/prefetch/base_prefetcher.cc
1265081Sgblack@eecs.umich.edu        mem/cache/prefetch/prefetcher.cc
1275081Sgblack@eecs.umich.edu        mem/cache/prefetch/tagged_prefetcher.cc
1285081Sgblack@eecs.umich.edu	mem/cache/tags/base_tags.cc
1295081Sgblack@eecs.umich.edu	mem/cache/tags/cache_tags.cc	
1305081Sgblack@eecs.umich.edu	mem/cache/tags/fa_lru.cc
1315081Sgblack@eecs.umich.edu	mem/cache/tags/iic.cc
1325081Sgblack@eecs.umich.edu	mem/cache/tags/lru.cc
1335081Sgblack@eecs.umich.edu	mem/cache/tags/repl/gen.cc
1345081Sgblack@eecs.umich.edu	mem/cache/tags/repl/repl.cc
1355081Sgblack@eecs.umich.edu	mem/cache/tags/split.cc
1365081Sgblack@eecs.umich.edu	mem/cache/tags/split_lru.cc
1375081Sgblack@eecs.umich.edu	mem/cache/tags/split_lifo.cc
1385081Sgblack@eecs.umich.edu	mem/functional/functional.cc
1395081Sgblack@eecs.umich.edu	mem/timing/base_memory.cc
1405081Sgblack@eecs.umich.edu	mem/timing/memory_builder.cc
1415081Sgblack@eecs.umich.edu	mem/timing/simple_mem_bank.cc
1425081Sgblack@eecs.umich.edu        mem/trace/itx_writer.cc
1435081Sgblack@eecs.umich.edu	mem/trace/mem_trace_writer.cc
1445081Sgblack@eecs.umich.edu	mem/trace/m5_writer.cc
1455680Sgblack@eecs.umich.edu
1465081Sgblack@eecs.umich.edu        python/pyconfig.cc
1475933Sgblack@eecs.umich.edu        python/embedded_py.cc
1485173Sgblack@eecs.umich.edu
1495359Sgblack@eecs.umich.edu	sim/builder.cc
1505081Sgblack@eecs.umich.edu	sim/configfile.cc
1515149Sgblack@eecs.umich.edu	sim/debug.cc
1525298Sgblack@eecs.umich.edu	sim/eventq.cc
1535081Sgblack@eecs.umich.edu	sim/faults.cc
1545081Sgblack@eecs.umich.edu	sim/main.cc
1555081Sgblack@eecs.umich.edu	sim/param.cc
1565081Sgblack@eecs.umich.edu	sim/profile.cc
1575081Sgblack@eecs.umich.edu	sim/root.cc
1585081Sgblack@eecs.umich.edu	sim/serialize.cc
1595081Sgblack@eecs.umich.edu	sim/sim_events.cc
1605081Sgblack@eecs.umich.edu	sim/sim_exit.cc
1615081Sgblack@eecs.umich.edu	sim/sim_object.cc
1625081Sgblack@eecs.umich.edu	sim/startup.cc
1635081Sgblack@eecs.umich.edu	sim/stat_context.cc
1645081Sgblack@eecs.umich.edu	sim/stat_control.cc
1655081Sgblack@eecs.umich.edu	sim/trace_context.cc
1665081Sgblack@eecs.umich.edu        ''')
1675081Sgblack@eecs.umich.edu
1685081Sgblack@eecs.umich.edu# Old FullCPU sources
1695081Sgblack@eecs.umich.edufull_cpu_sources = Split('''
1705081Sgblack@eecs.umich.edu	encumbered/cpu/full/bpred.cc
1715081Sgblack@eecs.umich.edu	encumbered/cpu/full/commit.cc
1725081Sgblack@eecs.umich.edu	encumbered/cpu/full/cpu.cc
1735081Sgblack@eecs.umich.edu	encumbered/cpu/full/create_vector.cc
1745081Sgblack@eecs.umich.edu	encumbered/cpu/full/cv_spec_state.cc
1755081Sgblack@eecs.umich.edu	encumbered/cpu/full/dd_queue.cc
1765081Sgblack@eecs.umich.edu	encumbered/cpu/full/dep_link.cc
1775081Sgblack@eecs.umich.edu	encumbered/cpu/full/dispatch.cc
1785081Sgblack@eecs.umich.edu	encumbered/cpu/full/dyn_inst.cc
1795081Sgblack@eecs.umich.edu	encumbered/cpu/full/execute.cc
1805081Sgblack@eecs.umich.edu	encumbered/cpu/full/fetch.cc
1815081Sgblack@eecs.umich.edu	encumbered/cpu/full/floss_reasons.cc
1825081Sgblack@eecs.umich.edu	encumbered/cpu/full/fu_pool.cc
1835081Sgblack@eecs.umich.edu	encumbered/cpu/full/inst_fifo.cc
1845081Sgblack@eecs.umich.edu	encumbered/cpu/full/instpipe.cc
1855081Sgblack@eecs.umich.edu	encumbered/cpu/full/issue.cc
1865081Sgblack@eecs.umich.edu	encumbered/cpu/full/ls_queue.cc
1875081Sgblack@eecs.umich.edu	encumbered/cpu/full/machine_queue.cc
1885081Sgblack@eecs.umich.edu        encumbered/cpu/full/pipetrace.cc
1895081Sgblack@eecs.umich.edu        encumbered/cpu/full/readyq.cc
1905081Sgblack@eecs.umich.edu        encumbered/cpu/full/reg_info.cc
1915081Sgblack@eecs.umich.edu        encumbered/cpu/full/rob_station.cc
1925081Sgblack@eecs.umich.edu        encumbered/cpu/full/spec_memory.cc
1935081Sgblack@eecs.umich.edu        encumbered/cpu/full/spec_state.cc
1945081Sgblack@eecs.umich.edu        encumbered/cpu/full/storebuffer.cc
1955081Sgblack@eecs.umich.edu        encumbered/cpu/full/writeback.cc
1965081Sgblack@eecs.umich.edu        encumbered/cpu/full/iq/iq_station.cc
1975081Sgblack@eecs.umich.edu        encumbered/cpu/full/iq/iqueue.cc
1985081Sgblack@eecs.umich.edu        encumbered/cpu/full/iq/segmented/chain_info.cc
1995081Sgblack@eecs.umich.edu        encumbered/cpu/full/iq/segmented/chain_wire.cc
2005081Sgblack@eecs.umich.edu        encumbered/cpu/full/iq/segmented/iq_seg.cc
2015081Sgblack@eecs.umich.edu        encumbered/cpu/full/iq/segmented/iq_segmented.cc
2025081Sgblack@eecs.umich.edu        encumbered/cpu/full/iq/segmented/seg_chain.cc
2035081Sgblack@eecs.umich.edu        encumbered/cpu/full/iq/seznec/iq_seznec.cc
2045081Sgblack@eecs.umich.edu        encumbered/cpu/full/iq/standard/iq_standard.cc
2055081Sgblack@eecs.umich.edu        ''')
2065081Sgblack@eecs.umich.edu
2075081Sgblack@eecs.umich.edu# MySql sources
2085081Sgblack@eecs.umich.edumysql_sources = Split('''
2095081Sgblack@eecs.umich.edu	base/mysql.cc
2105081Sgblack@eecs.umich.edu	base/stats/mysql.cc
2115081Sgblack@eecs.umich.edu        ''')
2125081Sgblack@eecs.umich.edu
2135081Sgblack@eecs.umich.edu# Full-system sources
2145081Sgblack@eecs.umich.edufull_system_sources = Split('''
2155081Sgblack@eecs.umich.edu	base/crc.cc
2165081Sgblack@eecs.umich.edu	base/inet.cc
2175081Sgblack@eecs.umich.edu	base/remote_gdb.cc
2185081Sgblack@eecs.umich.edu
2195081Sgblack@eecs.umich.edu	cpu/intr_control.cc
2205081Sgblack@eecs.umich.edu        cpu/profile.cc
2215081Sgblack@eecs.umich.edu
2225081Sgblack@eecs.umich.edu	dev/alpha_console.cc
2235081Sgblack@eecs.umich.edu	dev/baddev.cc
2245081Sgblack@eecs.umich.edu        dev/simconsole.cc
2255081Sgblack@eecs.umich.edu	dev/disk_image.cc
2265081Sgblack@eecs.umich.edu	dev/etherbus.cc
2275081Sgblack@eecs.umich.edu	dev/etherdump.cc
2285081Sgblack@eecs.umich.edu	dev/etherint.cc
2295081Sgblack@eecs.umich.edu	dev/etherlink.cc
2305081Sgblack@eecs.umich.edu	dev/etherpkt.cc
2315081Sgblack@eecs.umich.edu	dev/ethertap.cc
2325081Sgblack@eecs.umich.edu	dev/ide_ctrl.cc
2335081Sgblack@eecs.umich.edu	dev/ide_disk.cc
2345081Sgblack@eecs.umich.edu	dev/io_device.cc
2355081Sgblack@eecs.umich.edu	dev/ns_gige.cc
2365081Sgblack@eecs.umich.edu	dev/pciconfigall.cc
2375081Sgblack@eecs.umich.edu	dev/pcidev.cc
2385081Sgblack@eecs.umich.edu	dev/pcifake.cc
2395081Sgblack@eecs.umich.edu	dev/pktfifo.cc
2405081Sgblack@eecs.umich.edu	dev/platform.cc
2415081Sgblack@eecs.umich.edu	dev/sinic.cc
2425081Sgblack@eecs.umich.edu	dev/simple_disk.cc
2435081Sgblack@eecs.umich.edu	dev/tsunami.cc
2445081Sgblack@eecs.umich.edu	dev/tsunami_cchip.cc
2455081Sgblack@eecs.umich.edu	dev/isa_fake.cc
2465081Sgblack@eecs.umich.edu	dev/tsunami_io.cc
2475081Sgblack@eecs.umich.edu	dev/tsunami_pchip.cc
2485081Sgblack@eecs.umich.edu	dev/uart.cc
2495081Sgblack@eecs.umich.edu	dev/uart8250.cc
2505081Sgblack@eecs.umich.edu
2515081Sgblack@eecs.umich.edu	kern/kernel_binning.cc
2525081Sgblack@eecs.umich.edu	kern/kernel_stats.cc
2535081Sgblack@eecs.umich.edu	kern/system_events.cc
2545081Sgblack@eecs.umich.edu	kern/freebsd/freebsd_system.cc
2555081Sgblack@eecs.umich.edu	kern/linux/linux_syscalls.cc
2565081Sgblack@eecs.umich.edu	kern/linux/linux_system.cc
2575081Sgblack@eecs.umich.edu	kern/linux/printk.cc
2585081Sgblack@eecs.umich.edu	kern/tru64/dump_mbuf.cc
2595081Sgblack@eecs.umich.edu	kern/tru64/printf.cc
2605081Sgblack@eecs.umich.edu	kern/tru64/tru64_events.cc
2615081Sgblack@eecs.umich.edu	kern/tru64/tru64_syscalls.cc
2625081Sgblack@eecs.umich.edu	kern/tru64/tru64_system.cc
2635081Sgblack@eecs.umich.edu
2645081Sgblack@eecs.umich.edu	mem/functional/memory_control.cc
2655081Sgblack@eecs.umich.edu	mem/functional/physical.cc
2665081Sgblack@eecs.umich.edu
2675081Sgblack@eecs.umich.edu	sim/system.cc
2685081Sgblack@eecs.umich.edu	sim/pseudo_inst.cc
2695081Sgblack@eecs.umich.edu        ''')
2705081Sgblack@eecs.umich.edu
2715081Sgblack@eecs.umich.edu# turbolaser encumbered sources
2725081Sgblack@eecs.umich.eduturbolaser_sources = Split('''
2735081Sgblack@eecs.umich.edu	encumbered/dev/dma.cc
2745081Sgblack@eecs.umich.edu	encumbered/dev/etherdev.cc
2755081Sgblack@eecs.umich.edu	encumbered/dev/scsi.cc
2765081Sgblack@eecs.umich.edu	encumbered/dev/scsi_ctrl.cc
2775081Sgblack@eecs.umich.edu	encumbered/dev/scsi_disk.cc
2785081Sgblack@eecs.umich.edu	encumbered/dev/scsi_none.cc
2795081Sgblack@eecs.umich.edu	encumbered/dev/tlaser_clock.cc
2805081Sgblack@eecs.umich.edu	encumbered/dev/tlaser_ipi.cc
2815081Sgblack@eecs.umich.edu	encumbered/dev/tlaser_mbox.cc
2825081Sgblack@eecs.umich.edu	encumbered/dev/tlaser_mc146818.cc
2835081Sgblack@eecs.umich.edu	encumbered/dev/tlaser_node.cc
2845081Sgblack@eecs.umich.edu	encumbered/dev/tlaser_pcia.cc
2855081Sgblack@eecs.umich.edu	encumbered/dev/tlaser_pcidev.cc
2865081Sgblack@eecs.umich.edu	encumbered/dev/tlaser_serial.cc
2875081Sgblack@eecs.umich.edu	encumbered/dev/turbolaser.cc
2885081Sgblack@eecs.umich.edu	encumbered/dev/uart8530.cc
2895081Sgblack@eecs.umich.edu        ''')
2905081Sgblack@eecs.umich.edu
2915081Sgblack@eecs.umich.edu# Syscall emulation (non-full-system) sources
2925081Sgblack@eecs.umich.edusyscall_emulation_sources = Split('''
2935081Sgblack@eecs.umich.edu	cpu/memtest/memtest.cc
2945081Sgblack@eecs.umich.edu	encumbered/eio/eio.cc
2955081Sgblack@eecs.umich.edu	encumbered/eio/exolex.cc
2965081Sgblack@eecs.umich.edu	encumbered/eio/libexo.cc
2975081Sgblack@eecs.umich.edu        kern/linux/linux.cc
2985081Sgblack@eecs.umich.edu        kern/tru64/tru64.cc
2995081Sgblack@eecs.umich.edu	sim/process.cc
3005081Sgblack@eecs.umich.edu	sim/syscall_emul.cc
3015081Sgblack@eecs.umich.edu        ''')
3025081Sgblack@eecs.umich.edu
3035081Sgblack@eecs.umich.edu# The following stuff (targetarch code and global define of THE_ISA)
3045081Sgblack@eecs.umich.edu# are legacy things that assume we're only compiling one ISA at a
3055081Sgblack@eecs.umich.edu# time.  These will have to go away if we want to build a binary that
3065081Sgblack@eecs.umich.edu# supports multiple ISAs.
3075081Sgblack@eecs.umich.edu
3085069Sgblack@eecs.umich.edu#targetarch_files = Split('''
3094202Sbinkertn@umich.edu#        alpha_linux_process.hh
3104202Sbinkertn@umich.edu#        alpha_memory.hh
3114202Sbinkertn@umich.edu#        alpha_tru64_process.hh
3125069Sgblack@eecs.umich.edu#        aout_machdep.h
3135069Sgblack@eecs.umich.edu#        arguments.hh
3145069Sgblack@eecs.umich.edu#        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
322#for 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