SConscript revision 1730
1955SN/A# -*- mode:python -*-
2955SN/A
37816Ssteve.reinhardt@amd.com# Copyright (c) 2004 The Regents of The University of Michigan
45871Snate@binkert.org# All rights reserved.
51762SN/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.
28955SN/A
29955SN/Aimport os
302665Ssaidi@eecs.umich.eduimport sys
312665Ssaidi@eecs.umich.edufrom os.path import isdir
325863Snate@binkert.org
33955SN/A# This file defines how to build a particular configuration of M5
34955SN/A# based on variable settings in the 'env' build environment.
35955SN/A
36955SN/A# Import build environment variable from SConstruct.
37955SN/AImport('env')
382632Sstever@eecs.umich.edu
392632Sstever@eecs.umich.edu###################################################
402632Sstever@eecs.umich.edu#
412632Sstever@eecs.umich.edu# Define needed sources.
42955SN/A#
432632Sstever@eecs.umich.edu###################################################
442632Sstever@eecs.umich.edu
452761Sstever@eecs.umich.edu# Base sources used by all configurations.
462632Sstever@eecs.umich.edubase_sources = Split('''
472632Sstever@eecs.umich.edu	arch/alpha/decoder.cc
482632Sstever@eecs.umich.edu        arch/alpha/alpha_full_cpu_exec.cc
492761Sstever@eecs.umich.edu	arch/alpha/fast_cpu_exec.cc
502761Sstever@eecs.umich.edu	arch/alpha/simple_cpu_exec.cc
512761Sstever@eecs.umich.edu	arch/alpha/full_cpu_exec.cc
522632Sstever@eecs.umich.edu	arch/alpha/faults.cc
532632Sstever@eecs.umich.edu	arch/alpha/isa_traits.cc
542761Sstever@eecs.umich.edu
552761Sstever@eecs.umich.edu	base/circlebuf.cc
562761Sstever@eecs.umich.edu	base/copyright.cc
572761Sstever@eecs.umich.edu	base/cprintf.cc
582761Sstever@eecs.umich.edu        base/embedfile.cc
592632Sstever@eecs.umich.edu	base/fast_alloc.cc
602632Sstever@eecs.umich.edu	base/fifo_buffer.cc
612632Sstever@eecs.umich.edu	base/hostinfo.cc
622632Sstever@eecs.umich.edu	base/hybrid_pred.cc
632632Sstever@eecs.umich.edu	base/inifile.cc
642632Sstever@eecs.umich.edu	base/intmath.cc
652632Sstever@eecs.umich.edu	base/match.cc
66955SN/A	base/misc.cc
67955SN/A	base/output.cc
68955SN/A	base/pollevent.cc
695863Snate@binkert.org	base/python.cc
705863Snate@binkert.org	base/range.cc
715863Snate@binkert.org	base/random.cc
725863Snate@binkert.org	base/sat_counter.cc
735863Snate@binkert.org	base/socket.cc
745863Snate@binkert.org	base/statistics.cc
755863Snate@binkert.org	base/str.cc
765863Snate@binkert.org	base/time.cc
775863Snate@binkert.org	base/trace.cc
785863Snate@binkert.org	base/traceflags.cc
795863Snate@binkert.org	base/userinfo.cc
805863Snate@binkert.org	base/compression/lzss_compression.cc
815863Snate@binkert.org	base/loader/aout_object.cc
825863Snate@binkert.org	base/loader/ecoff_object.cc
835863Snate@binkert.org	base/loader/elf_object.cc
845863Snate@binkert.org	base/loader/object_file.cc
855863Snate@binkert.org	base/loader/symtab.cc
865863Snate@binkert.org	base/stats/events.cc
875863Snate@binkert.org	base/stats/python.cc
885863Snate@binkert.org	base/stats/statdb.cc
895863Snate@binkert.org	base/stats/visit.cc
905863Snate@binkert.org	base/stats/text.cc
915863Snate@binkert.org
925863Snate@binkert.org	cpu/base_cpu.cc
935863Snate@binkert.org        cpu/base_dyn_inst.cc
945863Snate@binkert.org	cpu/exec_context.cc
955863Snate@binkert.org	cpu/exetrace.cc
965863Snate@binkert.org	cpu/pc_event.cc
975863Snate@binkert.org	cpu/static_inst.cc
985863Snate@binkert.org        cpu/beta_cpu/2bit_local_pred.cc
995863Snate@binkert.org        cpu/beta_cpu/alpha_dyn_inst.cc
1006654Snate@binkert.org        cpu/beta_cpu/alpha_full_cpu.cc
101955SN/A        cpu/beta_cpu/alpha_full_cpu_builder.cc
1025396Ssaidi@eecs.umich.edu        cpu/beta_cpu/bpred_unit.cc
1035863Snate@binkert.org        cpu/beta_cpu/btb.cc
1045863Snate@binkert.org        cpu/beta_cpu/commit.cc
1054202Sbinkertn@umich.edu        cpu/beta_cpu/decode.cc
1065863Snate@binkert.org        cpu/beta_cpu/fetch.cc
1075863Snate@binkert.org        cpu/beta_cpu/free_list.cc
1085863Snate@binkert.org        cpu/beta_cpu/full_cpu.cc
1095863Snate@binkert.org        cpu/beta_cpu/iew.cc
110955SN/A        cpu/beta_cpu/inst_queue.cc
1116654Snate@binkert.org        cpu/beta_cpu/ldstq.cc
1125273Sstever@gmail.com        cpu/beta_cpu/mem_dep_unit.cc
1135871Snate@binkert.org        cpu/beta_cpu/ras.cc
1145273Sstever@gmail.com        cpu/beta_cpu/rename.cc
1156655Snate@binkert.org        cpu/beta_cpu/rename_map.cc
1166655Snate@binkert.org        cpu/beta_cpu/rob.cc
1176655Snate@binkert.org        cpu/beta_cpu/sat_counter.cc
1186655Snate@binkert.org        cpu/beta_cpu/store_set.cc
1196655Snate@binkert.org        cpu/beta_cpu/tournament_pred.cc
1206655Snate@binkert.org	cpu/fast_cpu/fast_cpu.cc
1215871Snate@binkert.org	cpu/full_cpu/bpred.cc
1226654Snate@binkert.org	cpu/full_cpu/commit.cc
1235396Ssaidi@eecs.umich.edu	cpu/full_cpu/create_vector.cc
1248120Sgblack@eecs.umich.edu	cpu/full_cpu/cv_spec_state.cc
1258120Sgblack@eecs.umich.edu	cpu/full_cpu/dd_queue.cc
1268120Sgblack@eecs.umich.edu	cpu/full_cpu/dep_link.cc
1278120Sgblack@eecs.umich.edu	cpu/full_cpu/dispatch.cc
1288120Sgblack@eecs.umich.edu	cpu/full_cpu/dyn_inst.cc
1298120Sgblack@eecs.umich.edu	cpu/full_cpu/execute.cc
1308120Sgblack@eecs.umich.edu	cpu/full_cpu/fetch.cc
1318120Sgblack@eecs.umich.edu	cpu/full_cpu/floss_reasons.cc
1328120Sgblack@eecs.umich.edu	cpu/full_cpu/fu_pool.cc
1338120Sgblack@eecs.umich.edu	cpu/full_cpu/full_cpu.cc
1348120Sgblack@eecs.umich.edu	cpu/full_cpu/inst_fifo.cc
1358120Sgblack@eecs.umich.edu	cpu/full_cpu/instpipe.cc
1368120Sgblack@eecs.umich.edu	cpu/full_cpu/issue.cc
1378120Sgblack@eecs.umich.edu	cpu/full_cpu/ls_queue.cc
1388120Sgblack@eecs.umich.edu	cpu/full_cpu/machine_queue.cc
1398120Sgblack@eecs.umich.edu        cpu/full_cpu/pc_sample_profile.cc
1408120Sgblack@eecs.umich.edu        cpu/full_cpu/pipetrace.cc
1418120Sgblack@eecs.umich.edu        cpu/full_cpu/readyq.cc
1428120Sgblack@eecs.umich.edu        cpu/full_cpu/reg_info.cc
1438120Sgblack@eecs.umich.edu        cpu/full_cpu/rob_station.cc
1448120Sgblack@eecs.umich.edu        cpu/full_cpu/spec_memory.cc
1458120Sgblack@eecs.umich.edu        cpu/full_cpu/spec_state.cc
1468120Sgblack@eecs.umich.edu        cpu/full_cpu/storebuffer.cc
1478120Sgblack@eecs.umich.edu        cpu/full_cpu/writeback.cc
1488120Sgblack@eecs.umich.edu        cpu/full_cpu/iq/iq_station.cc
1498120Sgblack@eecs.umich.edu        cpu/full_cpu/iq/iqueue.cc
1508120Sgblack@eecs.umich.edu        cpu/full_cpu/iq/segmented/chain_info.cc
1518120Sgblack@eecs.umich.edu        cpu/full_cpu/iq/segmented/chain_wire.cc
1528120Sgblack@eecs.umich.edu        cpu/full_cpu/iq/segmented/iq_seg.cc
1538120Sgblack@eecs.umich.edu        cpu/full_cpu/iq/segmented/iq_segmented.cc
1548120Sgblack@eecs.umich.edu        cpu/full_cpu/iq/segmented/seg_chain.cc
1558120Sgblack@eecs.umich.edu        cpu/full_cpu/iq/seznec/iq_seznec.cc
1568120Sgblack@eecs.umich.edu        cpu/full_cpu/iq/standard/iq_standard.cc
1578120Sgblack@eecs.umich.edu        cpu/sampling_cpu/sampling_cpu.cc
1588120Sgblack@eecs.umich.edu        cpu/simple_cpu/simple_cpu.cc
1598120Sgblack@eecs.umich.edu        cpu/trace/reader/mem_trace_reader.cc
1607816Ssteve.reinhardt@amd.com        cpu/trace/reader/ibm_reader.cc
1617816Ssteve.reinhardt@amd.com        cpu/trace/reader/itx_reader.cc
1627816Ssteve.reinhardt@amd.com        cpu/trace/reader/m5_reader.cc
1637816Ssteve.reinhardt@amd.com
1647816Ssteve.reinhardt@amd.com	mem/base_hier.cc
1657816Ssteve.reinhardt@amd.com	mem/base_mem.cc
1667816Ssteve.reinhardt@amd.com	mem/hier_params.cc
1677816Ssteve.reinhardt@amd.com	mem/mem_cmd.cc
1687816Ssteve.reinhardt@amd.com	mem/mem_debug.cc
1695871Snate@binkert.org	mem/mem_req.cc
1705871Snate@binkert.org	mem/memory_interface.cc
1716121Snate@binkert.org	mem/bus/base_interface.cc
1725871Snate@binkert.org	mem/bus/bus.cc
1735871Snate@binkert.org	mem/bus/bus_bridge.cc
1746003Snate@binkert.org	mem/bus/bus_bridge_master.cc
1756655Snate@binkert.org	mem/bus/bus_bridge_slave.cc
176955SN/A	mem/bus/bus_interface.cc
1775871Snate@binkert.org	mem/bus/dma_bus_interface.cc
1785871Snate@binkert.org	mem/bus/dma_interface.cc
1795871Snate@binkert.org	mem/bus/master_interface.cc
1805871Snate@binkert.org	mem/bus/slave_interface.cc
181955SN/A	mem/cache/base_cache.cc
1826121Snate@binkert.org	mem/cache/cache.cc
1836121Snate@binkert.org	mem/cache/cache_builder.cc
1846121Snate@binkert.org	mem/cache/coherence/coherence_protocol.cc
1851533SN/A	mem/cache/coherence/uni_coherence.cc
1866655Snate@binkert.org	mem/cache/miss/blocking_buffer.cc
1876655Snate@binkert.org	mem/cache/miss/miss_queue.cc
1886655Snate@binkert.org	mem/cache/miss/mshr.cc
1896655Snate@binkert.org	mem/cache/miss/mshr_queue.cc
1905871Snate@binkert.org        mem/cache/prefetch/base_prefetcher.cc
1915871Snate@binkert.org        mem/cache/prefetch/ghb_prefetcher.cc
1925863Snate@binkert.org        mem/cache/prefetch/prefetcher.cc
1935871Snate@binkert.org        mem/cache/prefetch/stride_prefetcher.cc
1945871Snate@binkert.org        mem/cache/prefetch/tagged_prefetcher.cc
1955871Snate@binkert.org	mem/cache/tags/base_tags.cc
1965871Snate@binkert.org	mem/cache/tags/cache_tags.cc
1975871Snate@binkert.org	mem/cache/tags/fa_lru.cc
1985863Snate@binkert.org	mem/cache/tags/iic.cc
1996121Snate@binkert.org	mem/cache/tags/lru.cc
2005863Snate@binkert.org	mem/cache/tags/split.cc
2015871Snate@binkert.org	mem/cache/tags/split_lifo.cc
2024678Snate@binkert.org	mem/cache/tags/split_lru.cc
2034678Snate@binkert.org	mem/cache/tags/repl/gen.cc
2044678Snate@binkert.org	mem/cache/tags/repl/repl.cc
2054678Snate@binkert.org	mem/functional_mem/functional_memory.cc
2064678Snate@binkert.org	mem/functional_mem/main_memory.cc
2074678Snate@binkert.org	mem/timing_mem/base_memory.cc
2084678Snate@binkert.org	mem/timing_mem/memory_builder.cc
2094678Snate@binkert.org	mem/timing_mem/simple_mem_bank.cc
2104678Snate@binkert.org        mem/trace/itx_writer.cc
2114678Snate@binkert.org	mem/trace/mem_trace_writer.cc
2124678Snate@binkert.org	mem/trace/m5_writer.cc
2137827Snate@binkert.org
2147827Snate@binkert.org        python/pyconfig.cc
2156121Snate@binkert.org        python/embedded_py.cc
2164678Snate@binkert.org
2175871Snate@binkert.org	sim/builder.cc
2185871Snate@binkert.org	sim/configfile.cc
2195871Snate@binkert.org	sim/debug.cc
2205871Snate@binkert.org	sim/eventq.cc
2215871Snate@binkert.org	sim/main.cc
2225871Snate@binkert.org	sim/param.cc
2235871Snate@binkert.org	sim/profile.cc
2245871Snate@binkert.org	sim/root.cc
2255871Snate@binkert.org	sim/serialize.cc
2265871Snate@binkert.org	sim/sim_events.cc
2275871Snate@binkert.org	sim/sim_exit.cc
2285871Snate@binkert.org	sim/sim_object.cc
2295871Snate@binkert.org	sim/startup.cc
2305871Snate@binkert.org	sim/stat_context.cc
2318126Sgblack@eecs.umich.edu	sim/stat_control.cc
2325871Snate@binkert.org	sim/trace_context.cc
2335871Snate@binkert.org        ''')
2348122Sgblack@eecs.umich.edu
2355871Snate@binkert.org# MySql sources
2365871Snate@binkert.orgmysql_sources = Split('''
2374678Snate@binkert.org	base/mysql.cc
2385871Snate@binkert.org	base/stats/mysql.cc
2394678Snate@binkert.org        ''')
2405871Snate@binkert.org
2415871Snate@binkert.org# Full-system sources
2425871Snate@binkert.orgfull_system_sources = Split('''
2435871Snate@binkert.org	arch/alpha/alpha_memory.cc
2445871Snate@binkert.org	arch/alpha/arguments.cc
2455871Snate@binkert.org	arch/alpha/ev5.cc
2465871Snate@binkert.org	arch/alpha/osfpal.cc
2475871Snate@binkert.org	arch/alpha/pseudo_inst.cc
2485871Snate@binkert.org	arch/alpha/vtophys.cc
2496121Snate@binkert.org
250955SN/A	base/crc.cc
251955SN/A	base/inet.cc
2522632Sstever@eecs.umich.edu	base/remote_gdb.cc
2532632Sstever@eecs.umich.edu
254955SN/A	cpu/intr_control.cc
255955SN/A
256955SN/A	dev/alpha_console.cc
257955SN/A	dev/baddev.cc
2585863Snate@binkert.org        dev/simconsole.cc
259955SN/A	dev/disk_image.cc
2602632Sstever@eecs.umich.edu	dev/dma.cc
2612632Sstever@eecs.umich.edu	dev/etherbus.cc
2622632Sstever@eecs.umich.edu	dev/etherdump.cc
2632632Sstever@eecs.umich.edu	dev/etherint.cc
2642632Sstever@eecs.umich.edu	dev/etherlink.cc
2652632Sstever@eecs.umich.edu	dev/etherpkt.cc
2662632Sstever@eecs.umich.edu	dev/ethertap.cc
2672632Sstever@eecs.umich.edu	dev/ide_ctrl.cc
2682632Sstever@eecs.umich.edu	dev/ide_disk.cc
2692632Sstever@eecs.umich.edu	dev/io_device.cc
2702632Sstever@eecs.umich.edu	dev/ns_gige.cc
2712632Sstever@eecs.umich.edu	dev/etherdev.cc
2722632Sstever@eecs.umich.edu	dev/pciconfigall.cc
2733718Sstever@eecs.umich.edu	dev/pcidev.cc
2743718Sstever@eecs.umich.edu	dev/pktfifo.cc
2753718Sstever@eecs.umich.edu	dev/scsi.cc
2763718Sstever@eecs.umich.edu	dev/scsi_ctrl.cc
2773718Sstever@eecs.umich.edu	dev/scsi_disk.cc
2785863Snate@binkert.org	dev/scsi_none.cc
2795863Snate@binkert.org	dev/sinic.cc
2803718Sstever@eecs.umich.edu	dev/simple_disk.cc
2813718Sstever@eecs.umich.edu	dev/tlaser_clock.cc
2826121Snate@binkert.org	dev/tlaser_ipi.cc
2835863Snate@binkert.org	dev/tlaser_mbox.cc
2843718Sstever@eecs.umich.edu	dev/tlaser_mc146818.cc
2853718Sstever@eecs.umich.edu	dev/tlaser_node.cc
2862634Sstever@eecs.umich.edu	dev/tlaser_pcia.cc
2872634Sstever@eecs.umich.edu	dev/tlaser_pcidev.cc
2885863Snate@binkert.org	dev/tlaser_serial.cc
2892638Sstever@eecs.umich.edu	dev/turbolaser.cc
2902632Sstever@eecs.umich.edu	dev/tsunami.cc
2912632Sstever@eecs.umich.edu	dev/tsunami_cchip.cc
2922632Sstever@eecs.umich.edu	dev/tsunami_fake.cc
2932632Sstever@eecs.umich.edu	dev/tsunami_io.cc
2942632Sstever@eecs.umich.edu	dev/tsunami_pchip.cc
2952632Sstever@eecs.umich.edu	dev/uart.cc
2961858SN/A	dev/uart8530.cc
2973716Sstever@eecs.umich.edu	dev/uart8250.cc
2982638Sstever@eecs.umich.edu
2992638Sstever@eecs.umich.edu	kern/kernel_binning.cc
3002638Sstever@eecs.umich.edu	kern/kernel_stats.cc
3012638Sstever@eecs.umich.edu	kern/system_events.cc
3022638Sstever@eecs.umich.edu	kern/linux/linux_events.cc
3032638Sstever@eecs.umich.edu	kern/linux/linux_syscalls.cc
3042638Sstever@eecs.umich.edu	kern/linux/linux_system.cc
3055863Snate@binkert.org	kern/linux/printk.cc
3065863Snate@binkert.org	kern/tru64/dump_mbuf.cc
3075863Snate@binkert.org	kern/tru64/printf.cc
308955SN/A	kern/tru64/tru64_events.cc
3095341Sstever@gmail.com	kern/tru64/tru64_syscalls.cc
3105341Sstever@gmail.com	kern/tru64/tru64_system.cc
3115863Snate@binkert.org
3127756SAli.Saidi@ARM.com	mem/functional_mem/memory_control.cc
3135341Sstever@gmail.com	mem/functional_mem/physical_memory.cc
3146121Snate@binkert.org        dev/platform.cc
3154494Ssaidi@eecs.umich.edu
3166121Snate@binkert.org	sim/system.cc
3171105SN/A        ''')
3182667Sstever@eecs.umich.edu
3192667Sstever@eecs.umich.edu# Syscall emulation (non-full-system) sources
3202667Sstever@eecs.umich.edusyscall_emulation_sources = Split('''
3212667Sstever@eecs.umich.edu	arch/alpha/alpha_common_syscall_emul.cc
3226121Snate@binkert.org	arch/alpha/alpha_linux_process.cc
3232667Sstever@eecs.umich.edu	arch/alpha/alpha_tru64_process.cc
3245341Sstever@gmail.com	cpu/memtest/memtest.cc
3255863Snate@binkert.org        cpu/trace/opt_cpu.cc
3265341Sstever@gmail.com	cpu/trace/trace_cpu.cc
3275341Sstever@gmail.com	eio/eio.cc
3285341Sstever@gmail.com	eio/exolex.cc
3295863Snate@binkert.org	eio/libexo.cc
3305341Sstever@gmail.com	sim/process.cc
3315341Sstever@gmail.com	sim/syscall_emul.cc
3325341Sstever@gmail.com        ''')
3335863Snate@binkert.org
3345341Sstever@gmail.comtargetarch_files = Split('''
3355341Sstever@gmail.com        alpha_common_syscall_emul.hh
3365341Sstever@gmail.com        alpha_linux_process.hh
3375341Sstever@gmail.com        alpha_memory.hh
3385341Sstever@gmail.com        alpha_tru64_process.hh
3395341Sstever@gmail.com        aout_machdep.h
3405341Sstever@gmail.com        arguments.hh
3415341Sstever@gmail.com        byte_swap.hh
3425341Sstever@gmail.com        ecoff_machdep.h
3435341Sstever@gmail.com        elf_machdep.h
3448120Sgblack@eecs.umich.edu        ev5.hh
3455341Sstever@gmail.com        faults.hh
3468120Sgblack@eecs.umich.edu        isa_fullsys_traits.hh
3475341Sstever@gmail.com        isa_traits.hh
3488120Sgblack@eecs.umich.edu        machine_exo.h
3496121Snate@binkert.org        osfpal.hh
3506121Snate@binkert.org        pseudo_inst.hh
3515397Ssaidi@eecs.umich.edu        vptr.hh
3525397Ssaidi@eecs.umich.edu        vtophys.hh
3537727SAli.Saidi@ARM.com        ''')
3548121Sgblack@eecs.umich.edu
3556168Snate@binkert.orgfor f in targetarch_files:
3566168Snate@binkert.org    env.Command('targetarch/' + f, 'arch/alpha/' + f,
3575341Sstever@gmail.com                '''echo '#include "arch/alpha/%s"' > $TARGET''' % f)
3588120Sgblack@eecs.umich.edu
3598120Sgblack@eecs.umich.edu
3608120Sgblack@eecs.umich.edu# Set up complete list of sources based on configuration.
3616814Sgblack@eecs.umich.edusources = base_sources
3625863Snate@binkert.org
3638120Sgblack@eecs.umich.eduif env['FULL_SYSTEM']:
3645341Sstever@gmail.com    sources += full_system_sources
3655863Snate@binkert.orgelse:
3665341Sstever@gmail.com    sources += syscall_emulation_sources
3676121Snate@binkert.org
3686121Snate@binkert.orgextra_libraries = []
3696121Snate@binkert.orgenv.Append(LIBS=['z'])
3705742Snate@binkert.orgif isdir('/usr/lib64/mysql') or isdir('/usr/lib/mysql') or \
3715742Snate@binkert.org   isdir('/usr/local/lib/mysql'):
3725341Sstever@gmail.com    print 'Compiling with MySQL support!'
3735742Snate@binkert.org    env.Append(LIBPATH=['/usr/lib64/mysql', '/usr/local/lib/mysql/',
3745742Snate@binkert.org                        '/usr/lib/mysql'])
3755341Sstever@gmail.com    env.Append(CPPPATH=['/usr/local/include/mysql', '/usr/include/mysql'])
3766017Snate@binkert.org    sources += mysql_sources
3776121Snate@binkert.org    env.Append(CPPDEFINES = 'USE_MYSQL')
3786017Snate@binkert.org    env.Append(CPPDEFINES = 'STATS_BINNING')
3797816Ssteve.reinhardt@amd.com    env.Append(LIBS=['mysqlclient'])
3807756SAli.Saidi@ARM.com
3817756SAli.Saidi@ARM.com###################################################
3827756SAli.Saidi@ARM.com#
3837756SAli.Saidi@ARM.com# Special build rules.
3847756SAli.Saidi@ARM.com#
3857756SAli.Saidi@ARM.com###################################################
3867756SAli.Saidi@ARM.com
3877756SAli.Saidi@ARM.com# base/traceflags.{cc,hh} are generated from base/traceflags.py.
3887816Ssteve.reinhardt@amd.com# $TARGET.base will expand to "<build-dir>/base/traceflags".
3897816Ssteve.reinhardt@amd.comenv.Command(Split('base/traceflags.hh base/traceflags.cc'),
3907816Ssteve.reinhardt@amd.com            'base/traceflags.py',
3917816Ssteve.reinhardt@amd.com            'python $SOURCE $TARGET.base')
3927816Ssteve.reinhardt@amd.com
3937816Ssteve.reinhardt@amd.com# several files are generated from arch/$TARGET_ISA/isa_desc.
3947816Ssteve.reinhardt@amd.comenv.Command(Split('''arch/alpha/decoder.cc
3957816Ssteve.reinhardt@amd.com		     arch/alpha/decoder.hh
3967816Ssteve.reinhardt@amd.com                     arch/alpha/alpha_full_cpu_exec.cc
3977816Ssteve.reinhardt@amd.com		     arch/alpha/fast_cpu_exec.cc
3987756SAli.Saidi@ARM.com                     arch/alpha/simple_cpu_exec.cc
3997816Ssteve.reinhardt@amd.com                     arch/alpha/full_cpu_exec.cc'''),
4007816Ssteve.reinhardt@amd.com            Split('''arch/alpha/isa_desc
4017816Ssteve.reinhardt@amd.com		     arch/isa_parser.py'''),
4027816Ssteve.reinhardt@amd.com            '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha')
4037816Ssteve.reinhardt@amd.com
4047816Ssteve.reinhardt@amd.com
4057816Ssteve.reinhardt@amd.com# libelf build is described in its own SConscript file.
4067816Ssteve.reinhardt@amd.com# SConscript-local is the per-config build, which just copies some
4077816Ssteve.reinhardt@amd.com# header files into a place where they can be found.
4087816Ssteve.reinhardt@amd.comSConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
4097816Ssteve.reinhardt@amd.comSConscript('python/SConscript', exports = ['env'], duplicate=0)
4107816Ssteve.reinhardt@amd.com
4117816Ssteve.reinhardt@amd.com# This function adds the specified sources to the given build
4127816Ssteve.reinhardt@amd.com# environment, and returns a list of all the corresponding SCons
4137816Ssteve.reinhardt@amd.com# Object nodes (including an extra one for date.cc).  We explicitly
4147816Ssteve.reinhardt@amd.com# add the Object nodes so we can set up special dependencies for
4157816Ssteve.reinhardt@amd.com# date.cc.
4167816Ssteve.reinhardt@amd.comdef make_objs(sources, env):
4177816Ssteve.reinhardt@amd.com    objs = [env.Object(s) for s in sources]
4187816Ssteve.reinhardt@amd.com    # make date.cc depend on all other objects so it always gets
4197816Ssteve.reinhardt@amd.com    # recompiled whenever anything else does
4207816Ssteve.reinhardt@amd.com    date_obj = env.Object('base/date.cc')
4217816Ssteve.reinhardt@amd.com    env.Depends(date_obj, objs)
4227816Ssteve.reinhardt@amd.com    objs.append(date_obj)
4237816Ssteve.reinhardt@amd.com    objs.extend(extra_libraries)
4247816Ssteve.reinhardt@amd.com    return objs
4257816Ssteve.reinhardt@amd.com
4267816Ssteve.reinhardt@amd.com###################################################
4277816Ssteve.reinhardt@amd.com#
4287816Ssteve.reinhardt@amd.com# Define binaries.  Each different build type (debug, opt, etc.) gets
4297816Ssteve.reinhardt@amd.com# a slightly different build environment.
4307816Ssteve.reinhardt@amd.com#
4317816Ssteve.reinhardt@amd.com###################################################
4327816Ssteve.reinhardt@amd.com
4337816Ssteve.reinhardt@amd.com# Include file paths are rooted in this directory.  SCons will
4347816Ssteve.reinhardt@amd.com# automatically expand '.' to refer to both the source directory and
4357816Ssteve.reinhardt@amd.com# the corresponding build directory to pick up generated include
4367816Ssteve.reinhardt@amd.com# files.
4377816Ssteve.reinhardt@amd.comenv.Append(CPPPATH='.')
4387816Ssteve.reinhardt@amd.com
4397816Ssteve.reinhardt@amd.com# Debug binary
4407816Ssteve.reinhardt@amd.comdebug = env.Copy(OBJSUFFIX='.do')
4417816Ssteve.reinhardt@amd.comdebug.Append(CCFLAGS=Split('-g -gstabs+ -O0'))
4427816Ssteve.reinhardt@amd.comdebug.Append(CPPDEFINES='DEBUG')
4437816Ssteve.reinhardt@amd.comdebug.Program(target = 'm5.debug', source = make_objs(sources, debug))
4447816Ssteve.reinhardt@amd.com
4457816Ssteve.reinhardt@amd.com# Optimized binary
4467816Ssteve.reinhardt@amd.comopt = env.Copy()
4477816Ssteve.reinhardt@amd.comopt.Append(CCFLAGS=Split('-g -O5'))
4487816Ssteve.reinhardt@amd.comopt.Program(target = 'm5.opt', source = make_objs(sources, opt))
4497816Ssteve.reinhardt@amd.com
4507816Ssteve.reinhardt@amd.com# "Fast" binary
4517816Ssteve.reinhardt@amd.comfast = env.Copy(OBJSUFFIX='.fo')
4527816Ssteve.reinhardt@amd.comfast.Append(CCFLAGS=Split('-O5'))
4537816Ssteve.reinhardt@amd.comfast.Append(CPPDEFINES='NDEBUG')
4547816Ssteve.reinhardt@amd.comfast.Program(target = 'm5.fast.unstripped', source = make_objs(sources, fast))
4557816Ssteve.reinhardt@amd.comfast.Command(target = 'm5.fast', source = 'm5.fast.unstripped',
4567816Ssteve.reinhardt@amd.com             action = 'strip $SOURCE -o $TARGET')
4577816Ssteve.reinhardt@amd.com
4587816Ssteve.reinhardt@amd.com# Profiled binary
4597816Ssteve.reinhardt@amd.comprof = env.Copy(OBJSUFFIX='.po')
4607756SAli.Saidi@ARM.comprof.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg')
4618120Sgblack@eecs.umich.eduprof.Program(target = 'm5.prof', source = make_objs(sources, prof))
4627756SAli.Saidi@ARM.com