SConscript revision 1696
1955SN/A# -*- mode:python -*-
2955SN/A
31762SN/A# Copyright (c) 2004 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###################################################
44955SN/A
45955SN/A# Base sources used by all configurations.
46955SN/Abase_sources = Split('''
474202Sbinkertn@umich.edu	arch/alpha/decoder.cc
48955SN/A        arch/alpha/alpha_full_cpu_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/inorder_cpu_exec.cc
526654Snate@binkert.org	arch/alpha/full_cpu_exec.cc
535517Snate@binkert.org	arch/alpha/faults.cc
546143Snate@binkert.org	arch/alpha/isa_traits.cc
556143Snate@binkert.org
566143Snate@binkert.org	base/circlebuf.cc
576143Snate@binkert.org	base/copyright.cc
586143Snate@binkert.org	base/cprintf.cc
596143Snate@binkert.org        base/embedfile.cc
606143Snate@binkert.org	base/fast_alloc.cc
616143Snate@binkert.org	base/fifo_buffer.cc
626143Snate@binkert.org	base/hostinfo.cc
636143Snate@binkert.org	base/hybrid_pred.cc
646143Snate@binkert.org	base/inifile.cc
656143Snate@binkert.org	base/intmath.cc
666143Snate@binkert.org	base/match.cc
676143Snate@binkert.org	base/misc.cc
686143Snate@binkert.org	base/output.cc
694762Snate@binkert.org	base/pollevent.cc
706143Snate@binkert.org	base/python.cc
716143Snate@binkert.org	base/range.cc
726143Snate@binkert.org	base/random.cc
736143Snate@binkert.org	base/sat_counter.cc
746143Snate@binkert.org	base/socket.cc
756143Snate@binkert.org	base/statistics.cc
766143Snate@binkert.org	base/str.cc
776143Snate@binkert.org	base/time.cc
786143Snate@binkert.org	base/trace.cc
796143Snate@binkert.org	base/traceflags.cc
806143Snate@binkert.org	base/userinfo.cc
816143Snate@binkert.org	base/compression/lzss_compression.cc
826143Snate@binkert.org	base/loader/aout_object.cc
836143Snate@binkert.org	base/loader/ecoff_object.cc
846143Snate@binkert.org	base/loader/elf_object.cc
856143Snate@binkert.org	base/loader/object_file.cc
866143Snate@binkert.org	base/loader/symtab.cc
876143Snate@binkert.org	base/stats/events.cc
886143Snate@binkert.org	base/stats/python.cc
896143Snate@binkert.org	base/stats/statdb.cc
906143Snate@binkert.org	base/stats/visit.cc
917065Snate@binkert.org	base/stats/text.cc
926143Snate@binkert.org
936143Snate@binkert.org	cpu/base_cpu.cc
946143Snate@binkert.org        cpu/base_dyn_inst.cc
956143Snate@binkert.org	cpu/exec_context.cc
966143Snate@binkert.org	cpu/exetrace.cc
976143Snate@binkert.org	cpu/pc_event.cc
986143Snate@binkert.org	cpu/static_inst.cc
996143Snate@binkert.org        cpu/beta_cpu/2bit_local_pred.cc
1006143Snate@binkert.org        cpu/beta_cpu/alpha_dyn_inst.cc
1016143Snate@binkert.org        cpu/beta_cpu/alpha_full_cpu.cc
1026143Snate@binkert.org        cpu/beta_cpu/alpha_full_cpu_builder.cc
1036143Snate@binkert.org        cpu/beta_cpu/bpred_unit.cc
1046143Snate@binkert.org        cpu/beta_cpu/btb.cc
1056143Snate@binkert.org        cpu/beta_cpu/commit.cc
1066143Snate@binkert.org        cpu/beta_cpu/decode.cc
1076143Snate@binkert.org        cpu/beta_cpu/fetch.cc
1086143Snate@binkert.org        cpu/beta_cpu/free_list.cc
1096143Snate@binkert.org        cpu/beta_cpu/full_cpu.cc
1106143Snate@binkert.org        cpu/beta_cpu/iew.cc
1116143Snate@binkert.org        cpu/beta_cpu/inst_queue.cc
1126143Snate@binkert.org        cpu/beta_cpu/ldstq.cc
1135522Snate@binkert.org        cpu/beta_cpu/mem_dep_unit.cc
1146143Snate@binkert.org        cpu/beta_cpu/ras.cc
1156143Snate@binkert.org        cpu/beta_cpu/rename.cc
1166143Snate@binkert.org        cpu/beta_cpu/rename_map.cc
1176143Snate@binkert.org        cpu/beta_cpu/rob.cc
1186143Snate@binkert.org        cpu/beta_cpu/sat_counter.cc
1196143Snate@binkert.org        cpu/beta_cpu/store_set.cc
1206143Snate@binkert.org        cpu/beta_cpu/tournament_pred.cc
1216143Snate@binkert.org	cpu/fast_cpu/fast_cpu.cc
1226143Snate@binkert.org	cpu/full_cpu/bpred.cc
1236143Snate@binkert.org	cpu/full_cpu/commit.cc
1245522Snate@binkert.org	cpu/full_cpu/create_vector.cc
1255522Snate@binkert.org	cpu/full_cpu/cv_spec_state.cc
1265522Snate@binkert.org	cpu/full_cpu/dd_queue.cc
1275522Snate@binkert.org	cpu/full_cpu/dep_link.cc
1285604Snate@binkert.org	cpu/full_cpu/dispatch.cc
1295604Snate@binkert.org	cpu/full_cpu/dyn_inst.cc
1306143Snate@binkert.org	cpu/full_cpu/execute.cc
1316143Snate@binkert.org	cpu/full_cpu/fetch.cc
1324762Snate@binkert.org	cpu/full_cpu/floss_reasons.cc
1334762Snate@binkert.org	cpu/full_cpu/fu_pool.cc
1346143Snate@binkert.org	cpu/full_cpu/full_cpu.cc
1356727Ssteve.reinhardt@amd.com	cpu/full_cpu/inst_fifo.cc
1366727Ssteve.reinhardt@amd.com	cpu/full_cpu/instpipe.cc
1376727Ssteve.reinhardt@amd.com	cpu/full_cpu/issue.cc
1384762Snate@binkert.org	cpu/full_cpu/ls_queue.cc
1396143Snate@binkert.org	cpu/full_cpu/machine_queue.cc
1406143Snate@binkert.org        cpu/full_cpu/pc_sample_profile.cc
1416143Snate@binkert.org        cpu/full_cpu/pipetrace.cc
1426143Snate@binkert.org        cpu/full_cpu/readyq.cc
1436727Ssteve.reinhardt@amd.com        cpu/full_cpu/reg_info.cc
1446143Snate@binkert.org        cpu/full_cpu/rob_station.cc
1456143Snate@binkert.org        cpu/full_cpu/spec_memory.cc
1466143Snate@binkert.org        cpu/full_cpu/spec_state.cc
1475604Snate@binkert.org        cpu/full_cpu/storebuffer.cc
1486143Snate@binkert.org        cpu/full_cpu/writeback.cc
1496143Snate@binkert.org        cpu/full_cpu/iq/iq_station.cc
1506143Snate@binkert.org        cpu/full_cpu/iq/iqueue.cc
1514762Snate@binkert.org        cpu/full_cpu/iq/segmented/chain_info.cc
1526143Snate@binkert.org        cpu/full_cpu/iq/segmented/chain_wire.cc
1534762Snate@binkert.org        cpu/full_cpu/iq/segmented/iq_seg.cc
1544762Snate@binkert.org        cpu/full_cpu/iq/segmented/iq_segmented.cc
1554762Snate@binkert.org        cpu/full_cpu/iq/segmented/seg_chain.cc
1566143Snate@binkert.org        cpu/full_cpu/iq/seznec/iq_seznec.cc
1576143Snate@binkert.org        cpu/full_cpu/iq/standard/iq_standard.cc
1584762Snate@binkert.org        cpu/inorder_cpu/inorder_cpu.cc
1596143Snate@binkert.org        cpu/sampling_cpu/sampling_cpu.cc
1606143Snate@binkert.org        cpu/simple_cpu/simple_cpu.cc
1616143Snate@binkert.org        cpu/trace/reader/mem_trace_reader.cc
1626143Snate@binkert.org        cpu/trace/reader/ibm_reader.cc
1634762Snate@binkert.org        cpu/trace/reader/itx_reader.cc
1646143Snate@binkert.org        cpu/trace/reader/m5_reader.cc
1654762Snate@binkert.org
1666143Snate@binkert.org	mem/base_hier.cc
1674762Snate@binkert.org	mem/base_mem.cc
1686143Snate@binkert.org	mem/hier_params.cc
1696143Snate@binkert.org	mem/mem_cmd.cc
1706143Snate@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
1756143Snate@binkert.org	mem/bus/bus_bridge.cc
1766143Snate@binkert.org	mem/bus/bus_bridge_master.cc
1776143Snate@binkert.org	mem/bus/bus_bridge_slave.cc
1786143Snate@binkert.org	mem/bus/bus_interface.cc
1796143Snate@binkert.org	mem/bus/dma_bus_interface.cc
1806143Snate@binkert.org	mem/bus/dma_interface.cc
181955SN/A	mem/bus/master_interface.cc
1825584Snate@binkert.org	mem/bus/slave_interface.cc
1835584Snate@binkert.org	mem/cache/base_cache.cc
1845584Snate@binkert.org	mem/cache/cache.cc
1855584Snate@binkert.org	mem/cache/cache_builder.cc
1866143Snate@binkert.org	mem/cache/coherence/coherence_protocol.cc
1876143Snate@binkert.org	mem/cache/coherence/uni_coherence.cc
1886143Snate@binkert.org	mem/cache/miss/blocking_buffer.cc
1895584Snate@binkert.org	mem/cache/miss/miss_queue.cc
1904382Sbinkertn@umich.edu	mem/cache/miss/mshr.cc
1914202Sbinkertn@umich.edu	mem/cache/miss/mshr_queue.cc
1924382Sbinkertn@umich.edu        mem/cache/prefetch/base_prefetcher.cc
1934382Sbinkertn@umich.edu        mem/cache/prefetch/ghb_prefetcher.cc
1944382Sbinkertn@umich.edu        mem/cache/prefetch/prefetcher.cc
1955584Snate@binkert.org        mem/cache/prefetch/stride_prefetcher.cc
1964382Sbinkertn@umich.edu        mem/cache/prefetch/tagged_prefetcher.cc
1974382Sbinkertn@umich.edu	mem/cache/tags/base_tags.cc
1984382Sbinkertn@umich.edu	mem/cache/tags/cache_tags.cc
1995192Ssaidi@eecs.umich.edu	mem/cache/tags/fa_lru.cc
2005192Ssaidi@eecs.umich.edu	mem/cache/tags/iic.cc
2015799Snate@binkert.org	mem/cache/tags/lru.cc
2025799Snate@binkert.org	mem/cache/tags/split.cc
2035799Snate@binkert.org	mem/cache/tags/split_lifo.cc
2045192Ssaidi@eecs.umich.edu	mem/cache/tags/split_lru.cc
2055799Snate@binkert.org	mem/cache/tags/repl/gen.cc
2065192Ssaidi@eecs.umich.edu	mem/cache/tags/repl/repl.cc
2075799Snate@binkert.org	mem/functional_mem/functional_memory.cc
2085799Snate@binkert.org	mem/functional_mem/main_memory.cc
2095192Ssaidi@eecs.umich.edu	mem/timing_mem/base_memory.cc
2105192Ssaidi@eecs.umich.edu	mem/timing_mem/memory_builder.cc
2115192Ssaidi@eecs.umich.edu	mem/timing_mem/simple_mem_bank.cc
2125799Snate@binkert.org        mem/trace/itx_writer.cc
2135192Ssaidi@eecs.umich.edu	mem/trace/mem_trace_writer.cc
2145192Ssaidi@eecs.umich.edu	mem/trace/m5_writer.cc
2155192Ssaidi@eecs.umich.edu
2165192Ssaidi@eecs.umich.edu        python/pyconfig.cc
2175192Ssaidi@eecs.umich.edu        python/embedded_py.cc
2185192Ssaidi@eecs.umich.edu
2194382Sbinkertn@umich.edu	sim/builder.cc
2204382Sbinkertn@umich.edu	sim/configfile.cc
2214382Sbinkertn@umich.edu	sim/debug.cc
2222667Sstever@eecs.umich.edu	sim/eventq.cc
2232667Sstever@eecs.umich.edu	sim/main.cc
2242667Sstever@eecs.umich.edu	sim/param.cc
2252667Sstever@eecs.umich.edu	sim/profile.cc
2262667Sstever@eecs.umich.edu	sim/root.cc
2272667Sstever@eecs.umich.edu	sim/serialize.cc
2285742Snate@binkert.org	sim/sim_events.cc
2295742Snate@binkert.org	sim/sim_exit.cc
2305742Snate@binkert.org	sim/sim_object.cc
2315793Snate@binkert.org	sim/startup.cc
2325793Snate@binkert.org	sim/stat_context.cc
2335793Snate@binkert.org	sim/stat_control.cc
2345793Snate@binkert.org	sim/trace_context.cc
2355793Snate@binkert.org        ''')
2364382Sbinkertn@umich.edu
2374762Snate@binkert.org# MySql sources
2385344Sstever@gmail.commysql_sources = Split('''
2394382Sbinkertn@umich.edu	base/mysql.cc
2405341Sstever@gmail.com	base/stats/mysql.cc
2415742Snate@binkert.org        ''')
2425742Snate@binkert.org
2435742Snate@binkert.org# Full-system sources
2445742Snate@binkert.orgfull_system_sources = Split('''
2455742Snate@binkert.org	arch/alpha/alpha_memory.cc
2464762Snate@binkert.org	arch/alpha/arguments.cc
2475742Snate@binkert.org	arch/alpha/ev5.cc
2485742Snate@binkert.org	arch/alpha/osfpal.cc
2495742Snate@binkert.org	arch/alpha/pseudo_inst.cc
2505742Snate@binkert.org	arch/alpha/vtophys.cc
2515742Snate@binkert.org
2525742Snate@binkert.org	base/crc.cc
2535742Snate@binkert.org	base/inet.cc
2545341Sstever@gmail.com	base/remote_gdb.cc
2555742Snate@binkert.org
2565341Sstever@gmail.com	cpu/intr_control.cc
2574773Snate@binkert.org
2586108Snate@binkert.org	dev/alpha_console.cc
2591858SN/A	dev/baddev.cc
2601085SN/A        dev/simconsole.cc
2616658Snate@binkert.org	dev/disk_image.cc
2626658Snate@binkert.org	dev/dma.cc
2636658Snate@binkert.org	dev/etherbus.cc
2646658Snate@binkert.org	dev/etherdump.cc
2656658Snate@binkert.org	dev/etherint.cc
2666658Snate@binkert.org	dev/etherlink.cc
2676658Snate@binkert.org	dev/etherpkt.cc
2686658Snate@binkert.org	dev/ethertap.cc
2696658Snate@binkert.org	dev/ide_ctrl.cc
2706658Snate@binkert.org	dev/ide_disk.cc
2716658Snate@binkert.org	dev/io_device.cc
2726658Snate@binkert.org	dev/ns_gige.cc
2736658Snate@binkert.org	dev/etherdev.cc
2746658Snate@binkert.org	dev/pciconfigall.cc
2756658Snate@binkert.org	dev/pcidev.cc
2766658Snate@binkert.org	dev/pktfifo.cc
2776658Snate@binkert.org	dev/scsi.cc
2786658Snate@binkert.org	dev/scsi_ctrl.cc
2796658Snate@binkert.org	dev/scsi_disk.cc
2806658Snate@binkert.org	dev/scsi_none.cc
2816658Snate@binkert.org	dev/sinic.cc
2826658Snate@binkert.org	dev/simple_disk.cc
2836658Snate@binkert.org	dev/tlaser_clock.cc
2846658Snate@binkert.org	dev/tlaser_ipi.cc
2856658Snate@binkert.org	dev/tlaser_mbox.cc
2864382Sbinkertn@umich.edu	dev/tlaser_mc146818.cc
2874382Sbinkertn@umich.edu	dev/tlaser_node.cc
2884762Snate@binkert.org	dev/tlaser_pcia.cc
2894762Snate@binkert.org	dev/tlaser_pcidev.cc
2904762Snate@binkert.org	dev/tlaser_serial.cc
2916654Snate@binkert.org	dev/turbolaser.cc
2926654Snate@binkert.org	dev/tsunami.cc
2935517Snate@binkert.org	dev/tsunami_cchip.cc
2945517Snate@binkert.org	dev/tsunami_fake.cc
2955517Snate@binkert.org	dev/tsunami_io.cc
2965517Snate@binkert.org	dev/tsunami_pchip.cc
2975517Snate@binkert.org	dev/uart.cc
2985517Snate@binkert.org
2995517Snate@binkert.org	kern/kernel_binning.cc
3005517Snate@binkert.org	kern/kernel_stats.cc
3015517Snate@binkert.org	kern/system_events.cc
3025517Snate@binkert.org	kern/linux/linux_events.cc
3035517Snate@binkert.org	kern/linux/linux_syscalls.cc
3045517Snate@binkert.org	kern/linux/linux_system.cc
3055517Snate@binkert.org	kern/linux/printk.cc
3065517Snate@binkert.org	kern/tru64/dump_mbuf.cc
3075517Snate@binkert.org	kern/tru64/printf.cc
3085517Snate@binkert.org	kern/tru64/tru64_events.cc
3095517Snate@binkert.org	kern/tru64/tru64_syscalls.cc
3106654Snate@binkert.org	kern/tru64/tru64_system.cc
3115517Snate@binkert.org
3125517Snate@binkert.org	mem/functional_mem/memory_control.cc
3135517Snate@binkert.org	mem/functional_mem/physical_memory.cc
3145517Snate@binkert.org        dev/platform.cc
3155517Snate@binkert.org
3165517Snate@binkert.org	sim/system.cc
3175517Snate@binkert.org        ''')
3185517Snate@binkert.org
3196143Snate@binkert.org# Syscall emulation (non-full-system) sources
3206654Snate@binkert.orgsyscall_emulation_sources = Split('''
3215517Snate@binkert.org	arch/alpha/alpha_common_syscall_emul.cc
3225517Snate@binkert.org	arch/alpha/alpha_linux_process.cc
3235517Snate@binkert.org	arch/alpha/alpha_tru64_process.cc
3245517Snate@binkert.org	cpu/memtest/memtest.cc
3255517Snate@binkert.org        cpu/trace/opt_cpu.cc
3265517Snate@binkert.org	cpu/trace/trace_cpu.cc
3275517Snate@binkert.org	eio/eio.cc
3285517Snate@binkert.org	eio/exolex.cc
3295517Snate@binkert.org	eio/libexo.cc
3305517Snate@binkert.org	sim/process.cc
3315517Snate@binkert.org	sim/syscall_emul.cc
3325517Snate@binkert.org        ''')
3335517Snate@binkert.org
3345517Snate@binkert.orgtargetarch_files = Split('''
3356654Snate@binkert.org        alpha_common_syscall_emul.hh
3366654Snate@binkert.org        alpha_linux_process.hh
3375517Snate@binkert.org        alpha_memory.hh
3385517Snate@binkert.org        alpha_tru64_process.hh
3396143Snate@binkert.org        aout_machdep.h
3406143Snate@binkert.org        arguments.hh
3416143Snate@binkert.org        byte_swap.hh
3426727Ssteve.reinhardt@amd.com        ecoff_machdep.h
3435517Snate@binkert.org        elf_machdep.h
3446727Ssteve.reinhardt@amd.com        ev5.hh
3455517Snate@binkert.org        faults.hh
3465517Snate@binkert.org        isa_fullsys_traits.hh
3475517Snate@binkert.org        isa_traits.hh
3486654Snate@binkert.org        machine_exo.h
3496654Snate@binkert.org        osfpal.hh
3506654Snate@binkert.org        pseudo_inst.hh
3516654Snate@binkert.org        vptr.hh
3526654Snate@binkert.org        vtophys.hh
3536654Snate@binkert.org        ''')
3545517Snate@binkert.org
3555517Snate@binkert.orgfor f in targetarch_files:
3565517Snate@binkert.org    env.Command('targetarch/' + f, 'arch/alpha/' + f,
3576143Snate@binkert.org                '''echo '#include "arch/alpha/%s"' > $TARGET''' % f)
3585517Snate@binkert.org
3594762Snate@binkert.org
3605517Snate@binkert.org# Set up complete list of sources based on configuration.
3615517Snate@binkert.orgsources = base_sources
3626143Snate@binkert.org
3636143Snate@binkert.orgif env['FULL_SYSTEM']:
3645517Snate@binkert.org    sources += full_system_sources
3655517Snate@binkert.orgelse:
3665517Snate@binkert.org    sources += syscall_emulation_sources
3675517Snate@binkert.org
3685517Snate@binkert.orgextra_libraries = []
3695517Snate@binkert.orgenv.Append(LIBS=['z'])
3705517Snate@binkert.orgif isdir('/usr/lib64/mysql') or isdir('/usr/lib/mysql') or \
3715517Snate@binkert.org   isdir('/usr/local/lib/mysql'):
3725517Snate@binkert.org    print 'Compiling with MySQL support!'
3735517Snate@binkert.org    env.Append(LIBPATH=['/usr/lib64/mysql', '/usr/local/lib/mysql/',
3746143Snate@binkert.org                        '/usr/lib/mysql'])
3755517Snate@binkert.org    env.Append(CPPPATH=['/usr/local/include/mysql', '/usr/include/mysql'])
3766654Snate@binkert.org    sources += mysql_sources
3776654Snate@binkert.org    env.Append(CPPDEFINES = 'USE_MYSQL')
3786654Snate@binkert.org    env.Append(CPPDEFINES = 'STATS_BINNING')
3796654Snate@binkert.org    env.Append(LIBS=['mysqlclient'])
3806654Snate@binkert.org
3816654Snate@binkert.org###################################################
3825517Snate@binkert.org#
3835517Snate@binkert.org# Special build rules.
3845517Snate@binkert.org#
3855517Snate@binkert.org###################################################
3865517Snate@binkert.org
3874762Snate@binkert.org# base/traceflags.{cc,hh} are generated from base/traceflags.py.
3884762Snate@binkert.org# $TARGET.base will expand to "<build-dir>/base/traceflags".
3894762Snate@binkert.orgenv.Command(Split('base/traceflags.hh base/traceflags.cc'),
3904762Snate@binkert.org            'base/traceflags.py',
3914762Snate@binkert.org            'python $SOURCE $TARGET.base')
3924762Snate@binkert.org
3936143Snate@binkert.org# several files are generated from arch/$TARGET_ISA/isa_desc.
3944762Snate@binkert.orgenv.Command(Split('''arch/alpha/decoder.cc
3954762Snate@binkert.org		     arch/alpha/decoder.hh
3964762Snate@binkert.org                     arch/alpha/alpha_full_cpu_exec.cc
3974762Snate@binkert.org		     arch/alpha/fast_cpu_exec.cc
3984382Sbinkertn@umich.edu                     arch/alpha/simple_cpu_exec.cc
3994382Sbinkertn@umich.edu                     arch/alpha/inorder_cpu_exec.cc
4005517Snate@binkert.org                     arch/alpha/full_cpu_exec.cc'''),
4016654Snate@binkert.org            Split('''arch/alpha/isa_desc
4025517Snate@binkert.org		     arch/isa_parser.py'''),
4035798Snate@binkert.org            '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha')
4046654Snate@binkert.org
4056654Snate@binkert.org
4066654Snate@binkert.org# libelf build is described in its own SConscript file.
4076654Snate@binkert.org# SConscript-local is the per-config build, which just copies some
4086654Snate@binkert.org# header files into a place where they can be found.
4096654Snate@binkert.orgSConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
4106654Snate@binkert.orgSConscript('python/SConscript', exports = ['env'], duplicate=0)
4116654Snate@binkert.org
4126654Snate@binkert.org# This function adds the specified sources to the given build
4136654Snate@binkert.org# environment, and returns a list of all the corresponding SCons
4146669Snate@binkert.org# Object nodes (including an extra one for date.cc).  We explicitly
4156669Snate@binkert.org# add the Object nodes so we can set up special dependencies for
4166669Snate@binkert.org# date.cc.
4176669Snate@binkert.orgdef make_objs(sources, env):
4186669Snate@binkert.org    objs = [env.Object(s) for s in sources]
4196669Snate@binkert.org    # make date.cc depend on all other objects so it always gets
4206654Snate@binkert.org    # recompiled whenever anything else does
4216654Snate@binkert.org    date_obj = env.Object('base/date.cc')
4225517Snate@binkert.org    env.Depends(date_obj, objs)
4235863Snate@binkert.org    objs.append(date_obj)
4245798Snate@binkert.org    objs.extend(extra_libraries)
4255798Snate@binkert.org    return objs
4265798Snate@binkert.org
4275798Snate@binkert.org###################################################
4285517Snate@binkert.org#
4295517Snate@binkert.org# Define binaries.  Each different build type (debug, opt, etc.) gets
4305517Snate@binkert.org# a slightly different build environment.
4315517Snate@binkert.org#
4325517Snate@binkert.org###################################################
4335517Snate@binkert.org
4345517Snate@binkert.org# Include file paths are rooted in this directory.  SCons will
4355517Snate@binkert.org# automatically expand '.' to refer to both the source directory and
4365798Snate@binkert.org# the corresponding build directory to pick up generated include
4375798Snate@binkert.org# files.
4385798Snate@binkert.orgenv.Append(CPPPATH='.')
4395798Snate@binkert.org
4405798Snate@binkert.org# Debug binary
4415798Snate@binkert.orgdebug = env.Copy(OBJSUFFIX='.do')
4425517Snate@binkert.orgdebug.Append(CCFLAGS=Split('-g -gstabs+ -O0'))
4435517Snate@binkert.orgdebug.Append(CPPDEFINES='DEBUG')
4445517Snate@binkert.orgdebug.Program(target = 'm5.debug', source = make_objs(sources, debug))
4455517Snate@binkert.org
4465517Snate@binkert.org# Optimized binary
4475517Snate@binkert.orgopt = env.Copy()
4485517Snate@binkert.orgopt.Append(CCFLAGS=Split('-g -O5'))
4495517Snate@binkert.orgopt.Program(target = 'm5.opt', source = make_objs(sources, opt))
4505517Snate@binkert.org
4514762Snate@binkert.org# "Fast" binary
4524382Sbinkertn@umich.edufast = env.Copy(OBJSUFFIX='.fo')
4536143Snate@binkert.orgfast.Append(CCFLAGS=Split('-O5'))
4545517Snate@binkert.orgfast.Append(CPPDEFINES='NDEBUG')
4554382Sbinkertn@umich.edufast.Program(target = 'm5.fast.unstripped', source = make_objs(sources, fast))
4564382Sbinkertn@umich.edufast.Command(target = 'm5.fast', source = 'm5.fast.unstripped',
4574762Snate@binkert.org             action = 'strip $SOURCE -o $TARGET')
4584762Snate@binkert.org
4594762Snate@binkert.org# Profiled binary
4604762Snate@binkert.orgprof = env.Copy(OBJSUFFIX='.po')
4614762Snate@binkert.orgprof.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg')
4625517Snate@binkert.orgprof.Program(target = 'm5.prof', source = make_objs(sources, prof))
4635517Snate@binkert.org