SConscript revision 1696
12623SN/A# -*- mode:python -*- 22623SN/A 32623SN/A# Copyright (c) 2004 The Regents of The University of Michigan 42623SN/A# All rights reserved. 52623SN/A# 62623SN/A# Redistribution and use in source and binary forms, with or without 72623SN/A# modification, are permitted provided that the following conditions are 82623SN/A# met: redistributions of source code must retain the above copyright 92623SN/A# notice, this list of conditions and the following disclaimer; 102623SN/A# redistributions in binary form must reproduce the above copyright 112623SN/A# notice, this list of conditions and the following disclaimer in the 122623SN/A# documentation and/or other materials provided with the distribution; 132623SN/A# neither the name of the copyright holders nor the names of its 142623SN/A# contributors may be used to endorse or promote products derived from 152623SN/A# this software without specific prior written permission. 162623SN/A# 172623SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 182623SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 192623SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 202623SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 212623SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 222623SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 232623SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 242623SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 252623SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 262623SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 272665Ssaidi@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 282665Ssaidi@eecs.umich.edu 292623SN/Aimport os 302623SN/Aimport sys 313170Sstever@eecs.umich.edufrom os.path import isdir 323806Ssaidi@eecs.umich.edu 332623SN/A# This file defines how to build a particular configuration of M5 342623SN/A# based on variable settings in the 'env' build environment. 352623SN/A 363348Sbinkertn@umich.edu# Import build environment variable from SConstruct. 373348Sbinkertn@umich.eduImport('env') 382623SN/A 392901Ssaidi@eecs.umich.edu################################################### 402623SN/A# 412623SN/A# Define needed sources. 422623SN/A# 432623SN/A################################################### 442623SN/A 452623SN/A# Base sources used by all configurations. 462623SN/Abase_sources = Split(''' 472623SN/A arch/alpha/decoder.cc 482623SN/A arch/alpha/alpha_full_cpu_exec.cc 492623SN/A arch/alpha/fast_cpu_exec.cc 502623SN/A arch/alpha/simple_cpu_exec.cc 512623SN/A arch/alpha/inorder_cpu_exec.cc 522623SN/A arch/alpha/full_cpu_exec.cc 532623SN/A arch/alpha/faults.cc 542623SN/A arch/alpha/isa_traits.cc 552623SN/A 562623SN/A base/circlebuf.cc 572623SN/A base/copyright.cc 582623SN/A base/cprintf.cc 592623SN/A base/embedfile.cc 602623SN/A base/fast_alloc.cc 612623SN/A base/fifo_buffer.cc 622856Srdreslin@umich.edu base/hostinfo.cc 632856Srdreslin@umich.edu base/hybrid_pred.cc 642856Srdreslin@umich.edu base/inifile.cc 652856Srdreslin@umich.edu base/intmath.cc 662856Srdreslin@umich.edu base/match.cc 672856Srdreslin@umich.edu base/misc.cc 682856Srdreslin@umich.edu base/output.cc 692856Srdreslin@umich.edu base/pollevent.cc 702856Srdreslin@umich.edu base/python.cc 712856Srdreslin@umich.edu base/range.cc 722623SN/A base/random.cc 732623SN/A base/sat_counter.cc 742623SN/A base/socket.cc 752623SN/A base/statistics.cc 762623SN/A base/str.cc 772623SN/A base/time.cc 782680Sktlim@umich.edu base/trace.cc 792680Sktlim@umich.edu base/traceflags.cc 802623SN/A base/userinfo.cc 812623SN/A base/compression/lzss_compression.cc 822680Sktlim@umich.edu base/loader/aout_object.cc 832623SN/A base/loader/ecoff_object.cc 842623SN/A base/loader/elf_object.cc 852623SN/A base/loader/object_file.cc 862623SN/A base/loader/symtab.cc 872623SN/A base/stats/events.cc 883349Sbinkertn@umich.edu base/stats/python.cc 892623SN/A base/stats/statdb.cc 903184Srdreslin@umich.edu base/stats/visit.cc 912623SN/A base/stats/text.cc 922623SN/A 932623SN/A cpu/base_cpu.cc 942623SN/A cpu/base_dyn_inst.cc 953349Sbinkertn@umich.edu cpu/exec_context.cc 962623SN/A cpu/exetrace.cc 973310Srdreslin@umich.edu cpu/pc_event.cc 983649Srdreslin@umich.edu cpu/static_inst.cc 992623SN/A cpu/beta_cpu/2bit_local_pred.cc 1002623SN/A cpu/beta_cpu/alpha_dyn_inst.cc 1012623SN/A cpu/beta_cpu/alpha_full_cpu.cc 1023349Sbinkertn@umich.edu cpu/beta_cpu/alpha_full_cpu_builder.cc 1032623SN/A cpu/beta_cpu/bpred_unit.cc 1043184Srdreslin@umich.edu cpu/beta_cpu/btb.cc 1053184Srdreslin@umich.edu cpu/beta_cpu/commit.cc 1062623SN/A cpu/beta_cpu/decode.cc 1072623SN/A cpu/beta_cpu/fetch.cc 1082623SN/A cpu/beta_cpu/free_list.cc 1092623SN/A cpu/beta_cpu/full_cpu.cc 1102623SN/A cpu/beta_cpu/iew.cc 1113647Srdreslin@umich.edu cpu/beta_cpu/inst_queue.cc 1123647Srdreslin@umich.edu cpu/beta_cpu/ldstq.cc 1133647Srdreslin@umich.edu cpu/beta_cpu/mem_dep_unit.cc 1143647Srdreslin@umich.edu cpu/beta_cpu/ras.cc 1153647Srdreslin@umich.edu cpu/beta_cpu/rename.cc 1162626SN/A cpu/beta_cpu/rename_map.cc 1173647Srdreslin@umich.edu cpu/beta_cpu/rob.cc 1182626SN/A cpu/beta_cpu/sat_counter.cc 1192623SN/A cpu/beta_cpu/store_set.cc 1202623SN/A cpu/beta_cpu/tournament_pred.cc 1212623SN/A cpu/fast_cpu/fast_cpu.cc 1222657Ssaidi@eecs.umich.edu cpu/full_cpu/bpred.cc 1232623SN/A cpu/full_cpu/commit.cc 1242623SN/A cpu/full_cpu/create_vector.cc 1252623SN/A cpu/full_cpu/cv_spec_state.cc 1262623SN/A cpu/full_cpu/dd_queue.cc 1272623SN/A cpu/full_cpu/dep_link.cc 1282623SN/A cpu/full_cpu/dispatch.cc 1292623SN/A cpu/full_cpu/dyn_inst.cc 1302623SN/A cpu/full_cpu/execute.cc 1312623SN/A cpu/full_cpu/fetch.cc 1322640Sstever@eecs.umich.edu cpu/full_cpu/floss_reasons.cc 1332623SN/A cpu/full_cpu/fu_pool.cc 1342623SN/A cpu/full_cpu/full_cpu.cc 1352623SN/A cpu/full_cpu/inst_fifo.cc 1363647Srdreslin@umich.edu cpu/full_cpu/instpipe.cc 1373647Srdreslin@umich.edu cpu/full_cpu/issue.cc 1383647Srdreslin@umich.edu cpu/full_cpu/ls_queue.cc 1392663Sstever@eecs.umich.edu cpu/full_cpu/machine_queue.cc 1403170Sstever@eecs.umich.edu cpu/full_cpu/pc_sample_profile.cc 1412641Sstever@eecs.umich.edu cpu/full_cpu/pipetrace.cc 1422623SN/A cpu/full_cpu/readyq.cc 1432623SN/A cpu/full_cpu/reg_info.cc 1442663Sstever@eecs.umich.edu cpu/full_cpu/rob_station.cc 1453170Sstever@eecs.umich.edu cpu/full_cpu/spec_memory.cc 1462641Sstever@eecs.umich.edu cpu/full_cpu/spec_state.cc 1472641Sstever@eecs.umich.edu cpu/full_cpu/storebuffer.cc 1482623SN/A cpu/full_cpu/writeback.cc 1492623SN/A cpu/full_cpu/iq/iq_station.cc 1502663Sstever@eecs.umich.edu cpu/full_cpu/iq/iqueue.cc 1513170Sstever@eecs.umich.edu cpu/full_cpu/iq/segmented/chain_info.cc 1522641Sstever@eecs.umich.edu cpu/full_cpu/iq/segmented/chain_wire.cc 1532641Sstever@eecs.umich.edu cpu/full_cpu/iq/segmented/iq_seg.cc 1542623SN/A cpu/full_cpu/iq/segmented/iq_segmented.cc 1552623SN/A cpu/full_cpu/iq/segmented/seg_chain.cc 1562623SN/A cpu/full_cpu/iq/seznec/iq_seznec.cc 1572623SN/A cpu/full_cpu/iq/standard/iq_standard.cc 1582623SN/A cpu/inorder_cpu/inorder_cpu.cc 1592623SN/A cpu/sampling_cpu/sampling_cpu.cc 1602623SN/A cpu/simple_cpu/simple_cpu.cc 1612623SN/A cpu/trace/reader/mem_trace_reader.cc 1622623SN/A cpu/trace/reader/ibm_reader.cc 1632623SN/A cpu/trace/reader/itx_reader.cc 1642915Sktlim@umich.edu cpu/trace/reader/m5_reader.cc 1652915Sktlim@umich.edu 1663177Shsul@eecs.umich.edu mem/base_hier.cc 1673177Shsul@eecs.umich.edu mem/base_mem.cc 1683145Shsul@eecs.umich.edu mem/hier_params.cc 1692623SN/A mem/mem_cmd.cc 1702623SN/A mem/mem_debug.cc 1712623SN/A mem/mem_req.cc 1722623SN/A mem/memory_interface.cc 1732623SN/A mem/bus/base_interface.cc 1742623SN/A mem/bus/bus.cc 1752623SN/A mem/bus/bus_bridge.cc 1762915Sktlim@umich.edu mem/bus/bus_bridge_master.cc 1772915Sktlim@umich.edu mem/bus/bus_bridge_slave.cc 1783177Shsul@eecs.umich.edu mem/bus/bus_interface.cc 1793145Shsul@eecs.umich.edu mem/bus/dma_bus_interface.cc 1802915Sktlim@umich.edu mem/bus/dma_interface.cc 1812915Sktlim@umich.edu mem/bus/master_interface.cc 1822915Sktlim@umich.edu mem/bus/slave_interface.cc 1832915Sktlim@umich.edu mem/cache/base_cache.cc 1842915Sktlim@umich.edu mem/cache/cache.cc 1852915Sktlim@umich.edu mem/cache/cache_builder.cc 1863324Shsul@eecs.umich.edu mem/cache/coherence/coherence_protocol.cc 1873201Shsul@eecs.umich.edu mem/cache/coherence/uni_coherence.cc 1883324Shsul@eecs.umich.edu mem/cache/miss/blocking_buffer.cc 1893324Shsul@eecs.umich.edu mem/cache/miss/miss_queue.cc 1903324Shsul@eecs.umich.edu mem/cache/miss/mshr.cc 1913431Sgblack@eecs.umich.edu mem/cache/miss/mshr_queue.cc 1923495Sktlim@umich.edu mem/cache/prefetch/base_prefetcher.cc 1933431Sgblack@eecs.umich.edu mem/cache/prefetch/ghb_prefetcher.cc 1943324Shsul@eecs.umich.edu mem/cache/prefetch/prefetcher.cc 1952915Sktlim@umich.edu mem/cache/prefetch/stride_prefetcher.cc 1962623SN/A mem/cache/prefetch/tagged_prefetcher.cc 1972623SN/A mem/cache/tags/base_tags.cc 1982623SN/A mem/cache/tags/cache_tags.cc 1992798Sktlim@umich.edu mem/cache/tags/fa_lru.cc 2002623SN/A mem/cache/tags/iic.cc 2012798Sktlim@umich.edu mem/cache/tags/lru.cc 2022798Sktlim@umich.edu mem/cache/tags/split.cc 2032623SN/A mem/cache/tags/split_lifo.cc 2042798Sktlim@umich.edu mem/cache/tags/split_lru.cc 2052623SN/A mem/cache/tags/repl/gen.cc 2062623SN/A mem/cache/tags/repl/repl.cc 2072623SN/A mem/functional_mem/functional_memory.cc 2082623SN/A mem/functional_mem/main_memory.cc 2092623SN/A mem/timing_mem/base_memory.cc 2102623SN/A mem/timing_mem/memory_builder.cc 2112623SN/A mem/timing_mem/simple_mem_bank.cc 2122623SN/A mem/trace/itx_writer.cc 2132623SN/A mem/trace/mem_trace_writer.cc 2142623SN/A mem/trace/m5_writer.cc 2152680Sktlim@umich.edu 2162623SN/A python/pyconfig.cc 2172680Sktlim@umich.edu python/embedded_py.cc 2182680Sktlim@umich.edu 2192680Sktlim@umich.edu sim/builder.cc 2202623SN/A sim/configfile.cc 2213495Sktlim@umich.edu sim/debug.cc 2222623SN/A sim/eventq.cc 2232623SN/A sim/main.cc 2242623SN/A sim/param.cc 2253512Sktlim@umich.edu sim/profile.cc 2263512Sktlim@umich.edu sim/root.cc 2273512Sktlim@umich.edu sim/serialize.cc 2282623SN/A sim/sim_events.cc 2292623SN/A sim/sim_exit.cc 2302623SN/A sim/sim_object.cc 2312623SN/A sim/startup.cc 2322623SN/A sim/stat_context.cc 2332623SN/A sim/stat_control.cc 2342623SN/A sim/trace_context.cc 2352683Sktlim@umich.edu ''') 2362623SN/A 2372623SN/A# MySql sources 2382623SN/Amysql_sources = Split(''' 2392623SN/A base/mysql.cc 2402623SN/A base/stats/mysql.cc 2413686Sktlim@umich.edu ''') 2423686Sktlim@umich.edu 2433686Sktlim@umich.edu# Full-system sources 2443686Sktlim@umich.edufull_system_sources = Split(''' 2453686Sktlim@umich.edu arch/alpha/alpha_memory.cc 2463686Sktlim@umich.edu arch/alpha/arguments.cc 2473686Sktlim@umich.edu arch/alpha/ev5.cc 2483430Sgblack@eecs.umich.edu arch/alpha/osfpal.cc 2493495Sktlim@umich.edu arch/alpha/pseudo_inst.cc 2502623SN/A arch/alpha/vtophys.cc 2512623SN/A 2522623SN/A base/crc.cc 2532623SN/A base/inet.cc 2542623SN/A base/remote_gdb.cc 2552623SN/A 2562623SN/A cpu/intr_control.cc 2572623SN/A 2582683Sktlim@umich.edu dev/alpha_console.cc 2592623SN/A dev/baddev.cc 2602623SN/A dev/simconsole.cc 2612626SN/A dev/disk_image.cc 2622626SN/A dev/dma.cc 2632626SN/A dev/etherbus.cc 2642626SN/A dev/etherdump.cc 2652626SN/A dev/etherint.cc 2662623SN/A dev/etherlink.cc 2672623SN/A dev/etherpkt.cc 2682623SN/A dev/ethertap.cc 2692623SN/A dev/ide_ctrl.cc 2702623SN/A dev/ide_disk.cc 2712623SN/A dev/io_device.cc 2722623SN/A dev/ns_gige.cc 2732623SN/A dev/etherdev.cc 2742623SN/A dev/pciconfigall.cc 2752623SN/A dev/pcidev.cc 2763169Sstever@eecs.umich.edu dev/pktfifo.cc 2773169Sstever@eecs.umich.edu dev/scsi.cc 2783349Sbinkertn@umich.edu dev/scsi_ctrl.cc 2793169Sstever@eecs.umich.edu dev/scsi_disk.cc 2803169Sstever@eecs.umich.edu dev/scsi_none.cc 2812623SN/A dev/sinic.cc 2822623SN/A dev/simple_disk.cc 2832623SN/A dev/tlaser_clock.cc 2842623SN/A dev/tlaser_ipi.cc 2852623SN/A dev/tlaser_mbox.cc 2862623SN/A dev/tlaser_mc146818.cc 2873169Sstever@eecs.umich.edu dev/tlaser_node.cc 2882623SN/A dev/tlaser_pcia.cc 2892623SN/A dev/tlaser_pcidev.cc 2902623SN/A dev/tlaser_serial.cc 2913169Sstever@eecs.umich.edu dev/turbolaser.cc 2922623SN/A dev/tsunami.cc 2933806Ssaidi@eecs.umich.edu dev/tsunami_cchip.cc 2943806Ssaidi@eecs.umich.edu dev/tsunami_fake.cc 2953806Ssaidi@eecs.umich.edu dev/tsunami_io.cc 2963806Ssaidi@eecs.umich.edu dev/tsunami_pchip.cc 2972623SN/A dev/uart.cc 2983814Ssaidi@eecs.umich.edu 2993814Ssaidi@eecs.umich.edu kern/kernel_binning.cc 3003814Ssaidi@eecs.umich.edu kern/kernel_stats.cc 3013814Ssaidi@eecs.umich.edu kern/system_events.cc 3023814Ssaidi@eecs.umich.edu kern/linux/linux_events.cc 3033169Sstever@eecs.umich.edu kern/linux/linux_syscalls.cc 3043170Sstever@eecs.umich.edu kern/linux/linux_system.cc 3053170Sstever@eecs.umich.edu kern/linux/printk.cc 3063170Sstever@eecs.umich.edu kern/tru64/dump_mbuf.cc 3073170Sstever@eecs.umich.edu kern/tru64/printf.cc 3082623SN/A kern/tru64/tru64_events.cc 3092623SN/A kern/tru64/tru64_syscalls.cc 3102623SN/A kern/tru64/tru64_system.cc 3113172Sstever@eecs.umich.edu 3122623SN/A mem/functional_mem/memory_control.cc 3132623SN/A mem/functional_mem/physical_memory.cc 3142623SN/A dev/platform.cc 3152623SN/A 3162623SN/A sim/system.cc 3172623SN/A ''') 3182623SN/A 3192623SN/A# Syscall emulation (non-full-system) sources 3202623SN/Asyscall_emulation_sources = Split(''' 3212623SN/A arch/alpha/alpha_common_syscall_emul.cc 3222623SN/A arch/alpha/alpha_linux_process.cc 3232623SN/A arch/alpha/alpha_tru64_process.cc 3242623SN/A cpu/memtest/memtest.cc 3252623SN/A cpu/trace/opt_cpu.cc 3262623SN/A cpu/trace/trace_cpu.cc 3272623SN/A eio/eio.cc 3282623SN/A eio/exolex.cc 3292623SN/A eio/libexo.cc 3302623SN/A sim/process.cc 3312623SN/A sim/syscall_emul.cc 3322623SN/A ''') 3332623SN/A 3342623SN/Atargetarch_files = Split(''' 3352623SN/A alpha_common_syscall_emul.hh 3362623SN/A alpha_linux_process.hh 3372623SN/A alpha_memory.hh 3382623SN/A alpha_tru64_process.hh 3392623SN/A aout_machdep.h 3402623SN/A arguments.hh 3412623SN/A byte_swap.hh 3422623SN/A ecoff_machdep.h 3432623SN/A elf_machdep.h 3442623SN/A ev5.hh 3452623SN/A faults.hh 3462623SN/A isa_fullsys_traits.hh 3472623SN/A isa_traits.hh 3482623SN/A machine_exo.h 3492623SN/A osfpal.hh 3502623SN/A pseudo_inst.hh 3512623SN/A vptr.hh 3522623SN/A vtophys.hh 3532623SN/A ''') 3542623SN/A 3552623SN/Afor f in targetarch_files: 3562623SN/A env.Command('targetarch/' + f, 'arch/alpha/' + f, 3572623SN/A '''echo '#include "arch/alpha/%s"' > $TARGET''' % f) 3582623SN/A 3592623SN/A 3602623SN/A# Set up complete list of sources based on configuration. 3612623SN/Asources = base_sources 3622623SN/A 3632623SN/Aif env['FULL_SYSTEM']: 3643169Sstever@eecs.umich.edu sources += full_system_sources 3653169Sstever@eecs.umich.eduelse: 3663349Sbinkertn@umich.edu sources += syscall_emulation_sources 3673169Sstever@eecs.umich.edu 3683169Sstever@eecs.umich.eduextra_libraries = [] 3692623SN/Aenv.Append(LIBS=['z']) 3702623SN/Aif isdir('/usr/lib64/mysql') or isdir('/usr/lib/mysql') or \ 3712623SN/A isdir('/usr/local/lib/mysql'): 3722623SN/A print 'Compiling with MySQL support!' 3732623SN/A env.Append(LIBPATH=['/usr/lib64/mysql', '/usr/local/lib/mysql/', 3742623SN/A '/usr/lib/mysql']) 3753169Sstever@eecs.umich.edu env.Append(CPPPATH=['/usr/local/include/mysql', '/usr/include/mysql']) 3762623SN/A sources += mysql_sources 3772623SN/A env.Append(CPPDEFINES = 'USE_MYSQL') 3782623SN/A env.Append(CPPDEFINES = 'STATS_BINNING') 3793170Sstever@eecs.umich.edu env.Append(LIBS=['mysqlclient']) 3802623SN/A 3813170Sstever@eecs.umich.edu################################################### 3823170Sstever@eecs.umich.edu# 3833170Sstever@eecs.umich.edu# Special build rules. 3842623SN/A# 3853170Sstever@eecs.umich.edu################################################### 3863170Sstever@eecs.umich.edu 3873170Sstever@eecs.umich.edu# base/traceflags.{cc,hh} are generated from base/traceflags.py. 3882631SN/A# $TARGET.base will expand to "<build-dir>/base/traceflags". 3893806Ssaidi@eecs.umich.eduenv.Command(Split('base/traceflags.hh base/traceflags.cc'), 3903806Ssaidi@eecs.umich.edu 'base/traceflags.py', 3913806Ssaidi@eecs.umich.edu 'python $SOURCE $TARGET.base') 3923806Ssaidi@eecs.umich.edu 3933806Ssaidi@eecs.umich.edu# several files are generated from arch/$TARGET_ISA/isa_desc. 3943806Ssaidi@eecs.umich.eduenv.Command(Split('''arch/alpha/decoder.cc 3953170Sstever@eecs.umich.edu arch/alpha/decoder.hh 3963170Sstever@eecs.umich.edu arch/alpha/alpha_full_cpu_exec.cc 3973814Ssaidi@eecs.umich.edu arch/alpha/fast_cpu_exec.cc 3983814Ssaidi@eecs.umich.edu arch/alpha/simple_cpu_exec.cc 3993814Ssaidi@eecs.umich.edu arch/alpha/inorder_cpu_exec.cc 4003814Ssaidi@eecs.umich.edu arch/alpha/full_cpu_exec.cc'''), 4013814Ssaidi@eecs.umich.edu Split('''arch/alpha/isa_desc 4023170Sstever@eecs.umich.edu arch/isa_parser.py'''), 4033170Sstever@eecs.umich.edu '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha') 4043170Sstever@eecs.umich.edu 4053170Sstever@eecs.umich.edu 4063170Sstever@eecs.umich.edu# libelf build is described in its own SConscript file. 4073170Sstever@eecs.umich.edu# SConscript-local is the per-config build, which just copies some 4083170Sstever@eecs.umich.edu# header files into a place where they can be found. 4093170Sstever@eecs.umich.eduSConscript('libelf/SConscript-local', exports = 'env', duplicate=0) 4103170Sstever@eecs.umich.eduSConscript('python/SConscript', exports = ['env'], duplicate=0) 4113170Sstever@eecs.umich.edu 4123170Sstever@eecs.umich.edu# This function adds the specified sources to the given build 4132631SN/A# environment, and returns a list of all the corresponding SCons 4142623SN/A# Object nodes (including an extra one for date.cc). We explicitly 4152623SN/A# add the Object nodes so we can set up special dependencies for 4162623SN/A# date.cc. 4173172Sstever@eecs.umich.edudef make_objs(sources, env): 4182623SN/A objs = [env.Object(s) for s in sources] 4192623SN/A # make date.cc depend on all other objects so it always gets 4202623SN/A # recompiled whenever anything else does 4212623SN/A date_obj = env.Object('base/date.cc') 4222623SN/A env.Depends(date_obj, objs) 4232623SN/A objs.append(date_obj) 4242623SN/A objs.extend(extra_libraries) 4252623SN/A return objs 4262623SN/A 4272623SN/A################################################### 4282623SN/A# 4292623SN/A# Define binaries. Each different build type (debug, opt, etc.) gets 4302623SN/A# a slightly different build environment. 4312623SN/A# 4322623SN/A################################################### 4332623SN/A 4342623SN/A# Include file paths are rooted in this directory. SCons will 4352623SN/A# automatically expand '.' to refer to both the source directory and 4362623SN/A# the corresponding build directory to pick up generated include 4372623SN/A# files. 4382623SN/Aenv.Append(CPPPATH='.') 4392623SN/A 4402623SN/A# Debug binary 4412623SN/Adebug = env.Copy(OBJSUFFIX='.do') 4422623SN/Adebug.Append(CCFLAGS=Split('-g -gstabs+ -O0')) 4432623SN/Adebug.Append(CPPDEFINES='DEBUG') 4442623SN/Adebug.Program(target = 'm5.debug', source = make_objs(sources, debug)) 4452623SN/A 4462623SN/A# Optimized binary 4472623SN/Aopt = env.Copy() 4482623SN/Aopt.Append(CCFLAGS=Split('-g -O5')) 4492623SN/Aopt.Program(target = 'm5.opt', source = make_objs(sources, opt)) 4502623SN/A 4512623SN/A# "Fast" binary 4522623SN/Afast = env.Copy(OBJSUFFIX='.fo') 4532623SN/Afast.Append(CCFLAGS=Split('-O5')) 4542623SN/Afast.Append(CPPDEFINES='NDEBUG') 4552623SN/Afast.Program(target = 'm5.fast.unstripped', source = make_objs(sources, fast)) 4562623SN/Afast.Command(target = 'm5.fast', source = 'm5.fast.unstripped', 4572623SN/A action = 'strip $SOURCE -o $TARGET') 4582623SN/A 4592623SN/A# Profiled binary 4602623SN/Aprof = env.Copy(OBJSUFFIX='.po') 4612623SN/Aprof.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg') 4622623SN/Aprof.Program(target = 'm5.prof', source = make_objs(sources, prof)) 4632623SN/A