SConscript revision 1762
1955SN/A# -*- mode:python -*-
2955SN/A
31762SN/A# Copyright (c) 2004-2005 The Regents of The University of Michigan
4955SN/A# All rights reserved.
5955SN/A#
6955SN/A# Redistribution and use in source and binary forms, with or without
7955SN/A# modification, are permitted provided that the following conditions are
8955SN/A# met: redistributions of source code must retain the above copyright
9955SN/A# notice, this list of conditions and the following disclaimer;
10955SN/A# redistributions in binary form must reproduce the above copyright
11955SN/A# notice, this list of conditions and the following disclaimer in the
12955SN/A# documentation and/or other materials provided with the distribution;
13955SN/A# neither the name of the copyright holders nor the names of its
14955SN/A# contributors may be used to endorse or promote products derived from
15955SN/A# this software without specific prior written permission.
16955SN/A#
17955SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18955SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19955SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20955SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21955SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22955SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23955SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24955SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25955SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26955SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27955SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282665Ssaidi@eecs.umich.edu
294762Snate@binkert.orgimport os
30955SN/Aimport sys
315522Snate@binkert.orgfrom os.path import isdir
326143Snate@binkert.org
334762Snate@binkert.org# This file defines how to build a particular configuration of M5
345522Snate@binkert.org# based on variable settings in the 'env' build environment.
35955SN/A
365522Snate@binkert.org# Import build environment variable from SConstruct.
37955SN/AImport('env')
385522Snate@binkert.org
394202Sbinkertn@umich.edu###################################################
405742Snate@binkert.org#
41955SN/A# Define needed sources.
424381Sbinkertn@umich.edu#
434381Sbinkertn@umich.edu###################################################
448334Snate@binkert.org
45955SN/A# Base sources used by all configurations.
46955SN/Abase_sources = Split('''
474202Sbinkertn@umich.edu	arch/alpha/decoder.cc
48955SN/A        arch/alpha/alpha_o3_exec.cc
494382Sbinkertn@umich.edu	arch/alpha/fast_cpu_exec.cc
504382Sbinkertn@umich.edu	arch/alpha/simple_cpu_exec.cc
514382Sbinkertn@umich.edu	arch/alpha/full_cpu_exec.cc
526654Snate@binkert.org	arch/alpha/faults.cc
535517Snate@binkert.org	arch/alpha/isa_traits.cc
548614Sgblack@eecs.umich.edu
557674Snate@binkert.org	base/circlebuf.cc
566143Snate@binkert.org	base/copyright.cc
576143Snate@binkert.org	base/cprintf.cc
586143Snate@binkert.org        base/embedfile.cc
598233Snate@binkert.org	base/fast_alloc.cc
608233Snate@binkert.org	base/fifo_buffer.cc
618233Snate@binkert.org	base/hostinfo.cc
628233Snate@binkert.org	base/hybrid_pred.cc
638233Snate@binkert.org	base/inifile.cc
648334Snate@binkert.org	base/intmath.cc
658334Snate@binkert.org	base/match.cc
668233Snate@binkert.org	base/misc.cc
678233Snate@binkert.org	base/output.cc
688233Snate@binkert.org	base/pollevent.cc
698233Snate@binkert.org	base/python.cc
708233Snate@binkert.org	base/range.cc
718233Snate@binkert.org	base/random.cc
726143Snate@binkert.org	base/sat_counter.cc
738233Snate@binkert.org	base/socket.cc
748233Snate@binkert.org	base/statistics.cc
758233Snate@binkert.org	base/str.cc
766143Snate@binkert.org	base/time.cc
776143Snate@binkert.org	base/trace.cc
786143Snate@binkert.org	base/traceflags.cc
796143Snate@binkert.org	base/userinfo.cc
808233Snate@binkert.org	base/compression/lzss_compression.cc
818233Snate@binkert.org	base/loader/aout_object.cc
828233Snate@binkert.org	base/loader/ecoff_object.cc
836143Snate@binkert.org	base/loader/elf_object.cc
848233Snate@binkert.org	base/loader/object_file.cc
858233Snate@binkert.org	base/loader/symtab.cc
868233Snate@binkert.org	base/stats/events.cc
878233Snate@binkert.org	base/stats/python.cc
886143Snate@binkert.org	base/stats/statdb.cc
896143Snate@binkert.org	base/stats/visit.cc
906143Snate@binkert.org	base/stats/text.cc
914762Snate@binkert.org
926143Snate@binkert.org	cpu/base.cc
938233Snate@binkert.org        cpu/base_dyn_inst.cc
948233Snate@binkert.org	cpu/exec_context.cc
958233Snate@binkert.org	cpu/exetrace.cc
968233Snate@binkert.org	cpu/pc_event.cc
978233Snate@binkert.org	cpu/static_inst.cc
986143Snate@binkert.org        cpu/o3/2bit_local_pred.cc
998233Snate@binkert.org        cpu/o3/alpha_dyn_inst.cc
1008233Snate@binkert.org        cpu/o3/alpha_cpu.cc
1018233Snate@binkert.org        cpu/o3/alpha_cpu_builder.cc
1028233Snate@binkert.org        cpu/o3/bpred_unit.cc
1036143Snate@binkert.org        cpu/o3/btb.cc
1046143Snate@binkert.org        cpu/o3/commit.cc
1056143Snate@binkert.org        cpu/o3/decode.cc
1066143Snate@binkert.org        cpu/o3/fetch.cc
1076143Snate@binkert.org        cpu/o3/free_list.cc
1086143Snate@binkert.org        cpu/o3/cpu.cc
1096143Snate@binkert.org        cpu/o3/iew.cc
1106143Snate@binkert.org        cpu/o3/inst_queue.cc
1116143Snate@binkert.org        cpu/o3/ldstq.cc
1127065Snate@binkert.org        cpu/o3/mem_dep_unit.cc
1136143Snate@binkert.org        cpu/o3/ras.cc
1148233Snate@binkert.org        cpu/o3/rename.cc
1158233Snate@binkert.org        cpu/o3/rename_map.cc
1168233Snate@binkert.org        cpu/o3/rob.cc
1178233Snate@binkert.org        cpu/o3/sat_counter.cc
1188233Snate@binkert.org        cpu/o3/store_set.cc
1198233Snate@binkert.org        cpu/o3/tournament_pred.cc
1208233Snate@binkert.org	cpu/fast/cpu.cc
1218233Snate@binkert.org        cpu/sampler/sampler.cc
1228233Snate@binkert.org        cpu/simple/cpu.cc
1238233Snate@binkert.org        cpu/trace/reader/mem_trace_reader.cc
1248233Snate@binkert.org        cpu/trace/reader/ibm_reader.cc
1258233Snate@binkert.org        cpu/trace/reader/itx_reader.cc
1268233Snate@binkert.org        cpu/trace/reader/m5_reader.cc
1278233Snate@binkert.org
1288233Snate@binkert.org	encumbered/cpu/full/bpred.cc
1298233Snate@binkert.org	encumbered/cpu/full/commit.cc
1308233Snate@binkert.org	encumbered/cpu/full/cpu.cc
1318233Snate@binkert.org	encumbered/cpu/full/create_vector.cc
1328233Snate@binkert.org	encumbered/cpu/full/cv_spec_state.cc
1338233Snate@binkert.org	encumbered/cpu/full/dd_queue.cc
1348233Snate@binkert.org	encumbered/cpu/full/dep_link.cc
1358233Snate@binkert.org	encumbered/cpu/full/dispatch.cc
1368233Snate@binkert.org	encumbered/cpu/full/dyn_inst.cc
1378233Snate@binkert.org	encumbered/cpu/full/execute.cc
1388233Snate@binkert.org	encumbered/cpu/full/fetch.cc
1398233Snate@binkert.org	encumbered/cpu/full/floss_reasons.cc
1408233Snate@binkert.org	encumbered/cpu/full/fu_pool.cc
1418233Snate@binkert.org	encumbered/cpu/full/inst_fifo.cc
1428233Snate@binkert.org	encumbered/cpu/full/instpipe.cc
1438233Snate@binkert.org	encumbered/cpu/full/issue.cc
1448233Snate@binkert.org	encumbered/cpu/full/ls_queue.cc
1456143Snate@binkert.org	encumbered/cpu/full/machine_queue.cc
1466143Snate@binkert.org        encumbered/cpu/full/pc_sample_profile.cc
1476143Snate@binkert.org        encumbered/cpu/full/pipetrace.cc
1486143Snate@binkert.org        encumbered/cpu/full/readyq.cc
1496143Snate@binkert.org        encumbered/cpu/full/reg_info.cc
1506143Snate@binkert.org        encumbered/cpu/full/rob_station.cc
1516143Snate@binkert.org        encumbered/cpu/full/spec_memory.cc
1526143Snate@binkert.org        encumbered/cpu/full/spec_state.cc
1536143Snate@binkert.org        encumbered/cpu/full/storebuffer.cc
1548945Ssteve.reinhardt@amd.com        encumbered/cpu/full/writeback.cc
1558233Snate@binkert.org        encumbered/cpu/full/iq/iq_station.cc
1568233Snate@binkert.org        encumbered/cpu/full/iq/iqueue.cc
1576143Snate@binkert.org        encumbered/cpu/full/iq/segmented/chain_info.cc
1588945Ssteve.reinhardt@amd.com        encumbered/cpu/full/iq/segmented/chain_wire.cc
1596143Snate@binkert.org        encumbered/cpu/full/iq/segmented/iq_seg.cc
1606143Snate@binkert.org        encumbered/cpu/full/iq/segmented/iq_segmented.cc
1616143Snate@binkert.org        encumbered/cpu/full/iq/segmented/seg_chain.cc
1626143Snate@binkert.org        encumbered/cpu/full/iq/seznec/iq_seznec.cc
1635522Snate@binkert.org        encumbered/cpu/full/iq/standard/iq_standard.cc
1646143Snate@binkert.org	encumbered/mem/functional/main.cc
1656143Snate@binkert.org
1666143Snate@binkert.org	mem/base_hier.cc
1676143Snate@binkert.org	mem/base_mem.cc
1688233Snate@binkert.org	mem/hier_params.cc
1698233Snate@binkert.org	mem/mem_cmd.cc
1708233Snate@binkert.org	mem/mem_debug.cc
1716143Snate@binkert.org	mem/mem_req.cc
1726143Snate@binkert.org	mem/memory_interface.cc
1736143Snate@binkert.org	mem/bus/base_interface.cc
1746143Snate@binkert.org	mem/bus/bus.cc
1755522Snate@binkert.org	mem/bus/bus_bridge.cc
1765522Snate@binkert.org	mem/bus/bus_bridge_master.cc
1775522Snate@binkert.org	mem/bus/bus_bridge_slave.cc
1785522Snate@binkert.org	mem/bus/bus_interface.cc
1795604Snate@binkert.org	mem/bus/dma_bus_interface.cc
1805604Snate@binkert.org	mem/bus/dma_interface.cc
1816143Snate@binkert.org	mem/bus/master_interface.cc
1826143Snate@binkert.org	mem/bus/slave_interface.cc
1834762Snate@binkert.org	mem/cache/base_cache.cc
1844762Snate@binkert.org	mem/cache/cache.cc
1856143Snate@binkert.org	mem/cache/cache_builder.cc
1866727Ssteve.reinhardt@amd.com	mem/cache/coherence/coherence_protocol.cc
1876727Ssteve.reinhardt@amd.com	mem/cache/coherence/uni_coherence.cc
1886727Ssteve.reinhardt@amd.com	mem/cache/miss/blocking_buffer.cc
1894762Snate@binkert.org	mem/cache/miss/miss_queue.cc
1906143Snate@binkert.org	mem/cache/miss/mshr.cc
1916143Snate@binkert.org	mem/cache/miss/mshr_queue.cc
1926143Snate@binkert.org        mem/cache/prefetch/base_prefetcher.cc
1936143Snate@binkert.org        mem/cache/prefetch/ghb_prefetcher.cc
1946727Ssteve.reinhardt@amd.com        mem/cache/prefetch/prefetcher.cc
1956143Snate@binkert.org        mem/cache/prefetch/stride_prefetcher.cc
1967674Snate@binkert.org        mem/cache/prefetch/tagged_prefetcher.cc
1977674Snate@binkert.org	mem/cache/tags/base_tags.cc
1985604Snate@binkert.org	mem/cache/tags/cache_tags.cc
1996143Snate@binkert.org	mem/cache/tags/fa_lru.cc
2006143Snate@binkert.org	mem/cache/tags/iic.cc
2016143Snate@binkert.org	mem/cache/tags/lru.cc
2024762Snate@binkert.org	mem/cache/tags/split.cc
2036143Snate@binkert.org	mem/cache/tags/split_lifo.cc
2044762Snate@binkert.org	mem/cache/tags/split_lru.cc
2054762Snate@binkert.org	mem/cache/tags/repl/gen.cc
2064762Snate@binkert.org	mem/cache/tags/repl/repl.cc
2076143Snate@binkert.org	mem/functional/functional.cc
2086143Snate@binkert.org	mem/timing/base_memory.cc
2094762Snate@binkert.org	mem/timing/memory_builder.cc
2108233Snate@binkert.org	mem/timing/simple_mem_bank.cc
2118233Snate@binkert.org        mem/trace/itx_writer.cc
2128233Snate@binkert.org	mem/trace/mem_trace_writer.cc
2138233Snate@binkert.org	mem/trace/m5_writer.cc
2146143Snate@binkert.org
2156143Snate@binkert.org        python/pyconfig.cc
2164762Snate@binkert.org        python/embedded_py.cc
2176143Snate@binkert.org
2184762Snate@binkert.org	sim/builder.cc
2196143Snate@binkert.org	sim/configfile.cc
2204762Snate@binkert.org	sim/debug.cc
2216143Snate@binkert.org	sim/eventq.cc
2228233Snate@binkert.org	sim/main.cc
2238233Snate@binkert.org	sim/param.cc
2248233Snate@binkert.org	sim/profile.cc
2256143Snate@binkert.org	sim/root.cc
2266143Snate@binkert.org	sim/serialize.cc
2276143Snate@binkert.org	sim/sim_events.cc
2286143Snate@binkert.org	sim/sim_exit.cc
2296143Snate@binkert.org	sim/sim_object.cc
2306143Snate@binkert.org	sim/startup.cc
2316143Snate@binkert.org	sim/stat_context.cc
2326143Snate@binkert.org	sim/stat_control.cc
2338233Snate@binkert.org	sim/trace_context.cc
2348233Snate@binkert.org        ''')
235955SN/A
2369396Sandreas.hansson@arm.com# MySql sources
2379396Sandreas.hansson@arm.commysql_sources = Split('''
2389396Sandreas.hansson@arm.com	base/mysql.cc
2399396Sandreas.hansson@arm.com	base/stats/mysql.cc
2409396Sandreas.hansson@arm.com        ''')
2419396Sandreas.hansson@arm.com
2429396Sandreas.hansson@arm.com# Full-system sources
2439396Sandreas.hansson@arm.comfull_system_sources = Split('''
2449396Sandreas.hansson@arm.com	arch/alpha/alpha_memory.cc
2459396Sandreas.hansson@arm.com	arch/alpha/arguments.cc
2469396Sandreas.hansson@arm.com	arch/alpha/ev5.cc
2479396Sandreas.hansson@arm.com	arch/alpha/osfpal.cc
2489396Sandreas.hansson@arm.com	arch/alpha/pseudo_inst.cc
2499396Sandreas.hansson@arm.com	arch/alpha/vtophys.cc
2509396Sandreas.hansson@arm.com
2519396Sandreas.hansson@arm.com	base/crc.cc
2528235Snate@binkert.org	base/inet.cc
2538235Snate@binkert.org	base/remote_gdb.cc
2546143Snate@binkert.org
2558235Snate@binkert.org	cpu/intr_control.cc
2569003SAli.Saidi@ARM.com
2578235Snate@binkert.org	dev/alpha_console.cc
2588235Snate@binkert.org	dev/baddev.cc
2598235Snate@binkert.org        dev/simconsole.cc
2608235Snate@binkert.org	dev/disk_image.cc
2618235Snate@binkert.org	dev/etherbus.cc
2628235Snate@binkert.org	dev/etherdump.cc
2638235Snate@binkert.org	dev/etherint.cc
2648235Snate@binkert.org	dev/etherlink.cc
2658235Snate@binkert.org	dev/etherpkt.cc
2668235Snate@binkert.org	dev/ethertap.cc
2678235Snate@binkert.org	dev/ide_ctrl.cc
2688235Snate@binkert.org	dev/ide_disk.cc
2698235Snate@binkert.org	dev/io_device.cc
2708235Snate@binkert.org	dev/ns_gige.cc
2719003SAli.Saidi@ARM.com	dev/pciconfigall.cc
2728235Snate@binkert.org	dev/pcidev.cc
2735584Snate@binkert.org	dev/pktfifo.cc
2744382Sbinkertn@umich.edu        dev/platform.cc
2754202Sbinkertn@umich.edu	dev/sinic.cc
2764382Sbinkertn@umich.edu	dev/simple_disk.cc
2774382Sbinkertn@umich.edu	dev/tsunami.cc
2784382Sbinkertn@umich.edu	dev/tsunami_cchip.cc
2799396Sandreas.hansson@arm.com	dev/tsunami_fake.cc
2805584Snate@binkert.org	dev/tsunami_io.cc
2814382Sbinkertn@umich.edu	dev/tsunami_pchip.cc
2824382Sbinkertn@umich.edu	dev/uart.cc
2834382Sbinkertn@umich.edu	dev/uart8250.cc
2848232Snate@binkert.org
2855192Ssaidi@eecs.umich.edu	kern/kernel_binning.cc
2868232Snate@binkert.org	kern/kernel_stats.cc
2878232Snate@binkert.org	kern/system_events.cc
2888232Snate@binkert.org	kern/linux/linux_events.cc
2895192Ssaidi@eecs.umich.edu	kern/linux/linux_syscalls.cc
2908232Snate@binkert.org	kern/linux/linux_system.cc
2915192Ssaidi@eecs.umich.edu	kern/linux/printk.cc
2925799Snate@binkert.org	kern/tru64/dump_mbuf.cc
2938232Snate@binkert.org	kern/tru64/printf.cc
2945192Ssaidi@eecs.umich.edu	kern/tru64/tru64_events.cc
2955192Ssaidi@eecs.umich.edu	kern/tru64/tru64_syscalls.cc
2965192Ssaidi@eecs.umich.edu	kern/tru64/tru64_system.cc
2978232Snate@binkert.org
2985192Ssaidi@eecs.umich.edu	mem/functional/memory_control.cc
2998232Snate@binkert.org	mem/functional/physical.cc
3005192Ssaidi@eecs.umich.edu
3015192Ssaidi@eecs.umich.edu	sim/system.cc
3025192Ssaidi@eecs.umich.edu        ''')
3035192Ssaidi@eecs.umich.edu
3044382Sbinkertn@umich.edu# turbolaser encumbered sources
3054382Sbinkertn@umich.eduturbolaser_sources = Split('''
3064382Sbinkertn@umich.edu	encumbered/dev/dma.cc
3072667Sstever@eecs.umich.edu	encumbered/dev/etherdev.cc
3082667Sstever@eecs.umich.edu	encumbered/dev/scsi.cc
3092667Sstever@eecs.umich.edu	encumbered/dev/scsi_ctrl.cc
3102667Sstever@eecs.umich.edu	encumbered/dev/scsi_disk.cc
3112667Sstever@eecs.umich.edu	encumbered/dev/scsi_none.cc
3122667Sstever@eecs.umich.edu	encumbered/dev/tlaser_clock.cc
3135742Snate@binkert.org	encumbered/dev/tlaser_ipi.cc
3145742Snate@binkert.org	encumbered/dev/tlaser_mbox.cc
3155742Snate@binkert.org	encumbered/dev/tlaser_mc146818.cc
3165793Snate@binkert.org	encumbered/dev/tlaser_node.cc
3178334Snate@binkert.org	encumbered/dev/tlaser_pcia.cc
3185793Snate@binkert.org	encumbered/dev/tlaser_pcidev.cc
3195793Snate@binkert.org	encumbered/dev/tlaser_serial.cc
3205793Snate@binkert.org	encumbered/dev/turbolaser.cc
3214382Sbinkertn@umich.edu	encumbered/dev/uart8530.cc
3224762Snate@binkert.org        ''')
3235344Sstever@gmail.com
3244382Sbinkertn@umich.edu# Syscall emulation (non-full-system) sources
3255341Sstever@gmail.comsyscall_emulation_sources = Split('''
3265742Snate@binkert.org	arch/alpha/alpha_common_syscall_emul.cc
3275742Snate@binkert.org	arch/alpha/alpha_linux_process.cc
3285742Snate@binkert.org	arch/alpha/alpha_tru64_process.cc
3295742Snate@binkert.org	cpu/memtest/memtest.cc
3305742Snate@binkert.org        cpu/trace/opt_cpu.cc
3314762Snate@binkert.org	cpu/trace/trace_cpu.cc
3325742Snate@binkert.org	encumbered/eio/eio.cc
3335742Snate@binkert.org	encumbered/eio/exolex.cc
3347722Sgblack@eecs.umich.edu	encumbered/eio/libexo.cc
3355742Snate@binkert.org	sim/process.cc
3365742Snate@binkert.org	sim/syscall_emul.cc
3375742Snate@binkert.org        ''')
3385742Snate@binkert.org
3398242Sbradley.danofsky@amd.comtargetarch_files = Split('''
3408242Sbradley.danofsky@amd.com        alpha_common_syscall_emul.hh
3418242Sbradley.danofsky@amd.com        alpha_linux_process.hh
3428242Sbradley.danofsky@amd.com        alpha_memory.hh
3435341Sstever@gmail.com        alpha_tru64_process.hh
3445742Snate@binkert.org        aout_machdep.h
3457722Sgblack@eecs.umich.edu        arguments.hh
3464773Snate@binkert.org        byte_swap.hh
3476108Snate@binkert.org        ecoff_machdep.h
3481858SN/A        elf_machdep.h
3491085SN/A        ev5.hh
3506658Snate@binkert.org        faults.hh
3516658Snate@binkert.org        isa_fullsys_traits.hh
3527673Snate@binkert.org        isa_traits.hh
3536658Snate@binkert.org        osfpal.hh
3546658Snate@binkert.org        pseudo_inst.hh
3556658Snate@binkert.org        vptr.hh
3566658Snate@binkert.org        vtophys.hh
3576658Snate@binkert.org        ''')
3586658Snate@binkert.org
3596658Snate@binkert.orgfor f in targetarch_files:
3607673Snate@binkert.org    env.Command('targetarch/' + f, 'arch/alpha/' + f,
3617673Snate@binkert.org                '''echo '#include "arch/alpha/%s"' > $TARGET''' % f)
3627673Snate@binkert.org
3637673Snate@binkert.org
3647673Snate@binkert.org# Set up complete list of sources based on configuration.
3657673Snate@binkert.orgsources = base_sources
3667673Snate@binkert.org
3676658Snate@binkert.orgif env['FULL_SYSTEM']:
3687673Snate@binkert.org    sources += full_system_sources
3697673Snate@binkert.org    if env['ALPHA_TLASER']:
3707673Snate@binkert.org        sources += turbolaser_sources
3717673Snate@binkert.orgelse:
3727673Snate@binkert.org    sources += syscall_emulation_sources
3737673Snate@binkert.org
3749048SAli.Saidi@ARM.comextra_libraries = []
3757673Snate@binkert.orgenv.Append(LIBS=['z'])
3767673Snate@binkert.orgif isdir('/usr/lib64/mysql') or isdir('/usr/lib/mysql') or \
3777673Snate@binkert.org   isdir('/usr/local/lib/mysql'):
3787673Snate@binkert.org    print 'Compiling with MySQL support!'
3796658Snate@binkert.org    env.Append(LIBPATH=['/usr/lib64/mysql', '/usr/local/lib/mysql/',
3807756SAli.Saidi@ARM.com                        '/usr/lib/mysql'])
3817816Ssteve.reinhardt@amd.com    env.Append(CPPPATH=['/usr/local/include/mysql', '/usr/include/mysql'])
3826658Snate@binkert.org    sources += mysql_sources
3834382Sbinkertn@umich.edu    env.Append(CPPDEFINES = 'USE_MYSQL')
3844382Sbinkertn@umich.edu    env.Append(CPPDEFINES = 'STATS_BINNING')
3854762Snate@binkert.org    env.Append(LIBS=['mysqlclient'])
3864762Snate@binkert.org
3874762Snate@binkert.org###################################################
3886654Snate@binkert.org#
3896654Snate@binkert.org# Special build rules.
3905517Snate@binkert.org#
3915517Snate@binkert.org###################################################
3925517Snate@binkert.org
3935517Snate@binkert.org# base/traceflags.{cc,hh} are generated from base/traceflags.py.
3945517Snate@binkert.org# $TARGET.base will expand to "<build-dir>/base/traceflags".
3955517Snate@binkert.orgenv.Command(Split('base/traceflags.hh base/traceflags.cc'),
3965517Snate@binkert.org            'base/traceflags.py',
3975517Snate@binkert.org            'python $SOURCE $TARGET.base')
3985517Snate@binkert.org
3995517Snate@binkert.org# several files are generated from arch/$TARGET_ISA/isa_desc.
4005517Snate@binkert.orgenv.Command(Split('''arch/alpha/decoder.cc
4015517Snate@binkert.org		     arch/alpha/decoder.hh
4025517Snate@binkert.org                     arch/alpha/alpha_o3_exec.cc
4035517Snate@binkert.org		     arch/alpha/fast_cpu_exec.cc
4045517Snate@binkert.org                     arch/alpha/simple_cpu_exec.cc
4055517Snate@binkert.org                     arch/alpha/full_cpu_exec.cc'''),
4065517Snate@binkert.org            Split('''arch/alpha/isa_desc
4076654Snate@binkert.org		     arch/isa_parser.py'''),
4085517Snate@binkert.org            '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha')
4095517Snate@binkert.org
4105517Snate@binkert.org
4115517Snate@binkert.org# libelf build is described in its own SConscript file.
4125517Snate@binkert.org# SConscript-local is the per-config build, which just copies some
4135517Snate@binkert.org# header files into a place where they can be found.
4145517Snate@binkert.orgSConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
4155517Snate@binkert.orgSConscript('python/SConscript', exports = ['env'], duplicate=0)
4166143Snate@binkert.org
4176654Snate@binkert.org# This function adds the specified sources to the given build
4185517Snate@binkert.org# environment, and returns a list of all the corresponding SCons
4195517Snate@binkert.org# Object nodes (including an extra one for date.cc).  We explicitly
4205517Snate@binkert.org# add the Object nodes so we can set up special dependencies for
4215517Snate@binkert.org# date.cc.
4225517Snate@binkert.orgdef make_objs(sources, env):
4235517Snate@binkert.org    objs = [env.Object(s) for s in sources]
4245517Snate@binkert.org    # make date.cc depend on all other objects so it always gets
4255517Snate@binkert.org    # recompiled whenever anything else does
4265517Snate@binkert.org    date_obj = env.Object('base/date.cc')
4275517Snate@binkert.org    env.Depends(date_obj, objs)
4285517Snate@binkert.org    objs.append(date_obj)
4295517Snate@binkert.org    objs.extend(extra_libraries)
4305517Snate@binkert.org    return objs
4315517Snate@binkert.org
4326654Snate@binkert.org###################################################
4336654Snate@binkert.org#
4345517Snate@binkert.org# Define binaries.  Each different build type (debug, opt, etc.) gets
4355517Snate@binkert.org# a slightly different build environment.
4366143Snate@binkert.org#
4376143Snate@binkert.org###################################################
4386143Snate@binkert.org
4396727Ssteve.reinhardt@amd.com# Include file paths are rooted in this directory.  SCons will
4405517Snate@binkert.org# automatically expand '.' to refer to both the source directory and
4416727Ssteve.reinhardt@amd.com# the corresponding build directory to pick up generated include
4425517Snate@binkert.org# files.
4435517Snate@binkert.orgenv.Append(CPPPATH='.')
4445517Snate@binkert.org
4456654Snate@binkert.org# Debug binary
4466654Snate@binkert.orgdebug = env.Copy(OBJSUFFIX='.do')
4477673Snate@binkert.orgdebug.Append(CCFLAGS=Split('-g -gstabs+ -O0'))
4486654Snate@binkert.orgdebug.Append(CPPDEFINES='DEBUG')
4496654Snate@binkert.orgdebug.Program(target = 'm5.debug', source = make_objs(sources, debug))
4506654Snate@binkert.org
4516654Snate@binkert.org# Optimized binary
4525517Snate@binkert.orgopt = env.Copy()
4535517Snate@binkert.orgopt.Append(CCFLAGS=Split('-g -O5'))
4545517Snate@binkert.orgopt.Program(target = 'm5.opt', source = make_objs(sources, opt))
4556143Snate@binkert.org
4565517Snate@binkert.org# "Fast" binary
4574762Snate@binkert.orgfast = env.Copy(OBJSUFFIX='.fo')
4585517Snate@binkert.orgfast.Append(CCFLAGS=Split('-O5'))
4595517Snate@binkert.orgfast.Append(CPPDEFINES='NDEBUG')
4606143Snate@binkert.orgfast.Program(target = 'm5.fast.unstripped', source = make_objs(sources, fast))
4616143Snate@binkert.orgfast.Command(target = 'm5.fast', source = 'm5.fast.unstripped',
4625517Snate@binkert.org             action = 'strip $SOURCE -o $TARGET')
4635517Snate@binkert.org
4645517Snate@binkert.org# Profiled binary
4655517Snate@binkert.orgprof = env.Copy(OBJSUFFIX='.po')
4665517Snate@binkert.orgprof.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg')
4675517Snate@binkert.orgprof.Program(target = 'm5.prof', source = make_objs(sources, prof))
4685517Snate@binkert.org