SConscript revision 2212
14519Sgblack@eecs.umich.edu# -*- mode:python -*- 24519Sgblack@eecs.umich.edu 34519Sgblack@eecs.umich.edu# Copyright (c) 2004-2005 The Regents of The University of Michigan 44519Sgblack@eecs.umich.edu# All rights reserved. 54519Sgblack@eecs.umich.edu# 64519Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without 74519Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are 84519Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright 94519Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer; 104519Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright 114519Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the 124519Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution; 134519Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its 144519Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from 154519Sgblack@eecs.umich.edu# this software without specific prior written permission. 164519Sgblack@eecs.umich.edu# 174519Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 184519Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 194519Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 204519Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 214519Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 224519Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 234519Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 244519Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 254519Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 264519Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 274519Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 284519Sgblack@eecs.umich.edu 294519Sgblack@eecs.umich.eduimport os 304519Sgblack@eecs.umich.eduimport sys 314519Sgblack@eecs.umich.edufrom os.path import isdir 324519Sgblack@eecs.umich.edu 334519Sgblack@eecs.umich.edu# This file defines how to build a particular configuration of M5 344519Sgblack@eecs.umich.edu# based on variable settings in the 'env' build environment. 354519Sgblack@eecs.umich.edu 364519Sgblack@eecs.umich.edu# Import build environment variable from SConstruct. 374519Sgblack@eecs.umich.eduImport('env') 384519Sgblack@eecs.umich.edu 394519Sgblack@eecs.umich.edu################################################### 404519Sgblack@eecs.umich.edu# 414519Sgblack@eecs.umich.edu# Define needed sources. 424519Sgblack@eecs.umich.edu# 434519Sgblack@eecs.umich.edu################################################### 444519Sgblack@eecs.umich.edu 454519Sgblack@eecs.umich.edu# Base sources used by all configurations. 464519Sgblack@eecs.umich.edu 474519Sgblack@eecs.umich.edubase_sources = Split(''' 484519Sgblack@eecs.umich.edu base/circlebuf.cc 494519Sgblack@eecs.umich.edu base/copyright.cc 504519Sgblack@eecs.umich.edu base/cprintf.cc 514519Sgblack@eecs.umich.edu base/embedfile.cc 524519Sgblack@eecs.umich.edu base/fast_alloc.cc 534519Sgblack@eecs.umich.edu base/fifo_buffer.cc 544519Sgblack@eecs.umich.edu base/hostinfo.cc 554519Sgblack@eecs.umich.edu base/hybrid_pred.cc 564519Sgblack@eecs.umich.edu base/inifile.cc 574519Sgblack@eecs.umich.edu base/intmath.cc 584519Sgblack@eecs.umich.edu base/match.cc 594519Sgblack@eecs.umich.edu base/misc.cc 604519Sgblack@eecs.umich.edu base/output.cc 614519Sgblack@eecs.umich.edu base/pollevent.cc 624519Sgblack@eecs.umich.edu base/range.cc 634519Sgblack@eecs.umich.edu base/random.cc 644519Sgblack@eecs.umich.edu base/sat_counter.cc 654519Sgblack@eecs.umich.edu base/socket.cc 664519Sgblack@eecs.umich.edu base/statistics.cc 674519Sgblack@eecs.umich.edu base/str.cc 684809Sgblack@eecs.umich.edu base/time.cc 694519Sgblack@eecs.umich.edu base/trace.cc 704519Sgblack@eecs.umich.edu base/traceflags.cc 714688Sgblack@eecs.umich.edu base/userinfo.cc 724688Sgblack@eecs.umich.edu base/compression/lzss_compression.cc 734688Sgblack@eecs.umich.edu base/loader/aout_object.cc 744688Sgblack@eecs.umich.edu base/loader/ecoff_object.cc 754688Sgblack@eecs.umich.edu base/loader/elf_object.cc 764688Sgblack@eecs.umich.edu base/loader/object_file.cc 774708Sgblack@eecs.umich.edu base/loader/symtab.cc 784708Sgblack@eecs.umich.edu base/stats/events.cc 794708Sgblack@eecs.umich.edu base/stats/statdb.cc 804708Sgblack@eecs.umich.edu base/stats/visit.cc 814519Sgblack@eecs.umich.edu base/stats/text.cc 824519Sgblack@eecs.umich.edu 834519Sgblack@eecs.umich.edu cpu/base.cc 844519Sgblack@eecs.umich.edu cpu/base_dyn_inst.cc 854519Sgblack@eecs.umich.edu cpu/exec_context.cc 864519Sgblack@eecs.umich.edu cpu/exetrace.cc 874519Sgblack@eecs.umich.edu cpu/pc_event.cc 884519Sgblack@eecs.umich.edu cpu/static_inst.cc 894519Sgblack@eecs.umich.edu cpu/sampler/sampler.cc 904519Sgblack@eecs.umich.edu cpu/trace/reader/mem_trace_reader.cc 914519Sgblack@eecs.umich.edu cpu/trace/reader/ibm_reader.cc 924951Sgblack@eecs.umich.edu cpu/trace/reader/itx_reader.cc 934519Sgblack@eecs.umich.edu cpu/trace/reader/m5_reader.cc 944519Sgblack@eecs.umich.edu cpu/trace/opt_cpu.cc 954519Sgblack@eecs.umich.edu cpu/trace/trace_cpu.cc 964519Sgblack@eecs.umich.edu 974519Sgblack@eecs.umich.edu encumbered/mem/functional/main.cc 984519Sgblack@eecs.umich.edu 994688Sgblack@eecs.umich.edu mem/base_hier.cc 1004688Sgblack@eecs.umich.edu mem/base_mem.cc 1014688Sgblack@eecs.umich.edu mem/hier_params.cc 1024688Sgblack@eecs.umich.edu mem/mem_cmd.cc 1034688Sgblack@eecs.umich.edu mem/mem_debug.cc 1044688Sgblack@eecs.umich.edu mem/mem_req.cc 1054708Sgblack@eecs.umich.edu mem/memory_interface.cc 1064708Sgblack@eecs.umich.edu mem/bus/base_interface.cc 1074708Sgblack@eecs.umich.edu mem/bus/bus.cc 1084708Sgblack@eecs.umich.edu mem/bus/bus_bridge.cc 1094519Sgblack@eecs.umich.edu mem/bus/bus_bridge_master.cc 1104519Sgblack@eecs.umich.edu mem/bus/bus_bridge_slave.cc 1114519Sgblack@eecs.umich.edu mem/bus/bus_interface.cc 1124519Sgblack@eecs.umich.edu mem/bus/dma_bus_interface.cc 1134519Sgblack@eecs.umich.edu mem/bus/dma_interface.cc 1144519Sgblack@eecs.umich.edu mem/bus/master_interface.cc 1154519Sgblack@eecs.umich.edu mem/bus/slave_interface.cc 1164519Sgblack@eecs.umich.edu mem/cache/base_cache.cc 1174519Sgblack@eecs.umich.edu mem/cache/cache.cc 1184519Sgblack@eecs.umich.edu mem/cache/cache_builder.cc 1194519Sgblack@eecs.umich.edu mem/cache/coherence/coherence_protocol.cc 1204519Sgblack@eecs.umich.edu mem/cache/coherence/uni_coherence.cc 1214519Sgblack@eecs.umich.edu mem/cache/miss/blocking_buffer.cc 1224519Sgblack@eecs.umich.edu mem/cache/miss/miss_queue.cc 1234519Sgblack@eecs.umich.edu mem/cache/miss/mshr.cc 1244519Sgblack@eecs.umich.edu mem/cache/miss/mshr_queue.cc 1254519Sgblack@eecs.umich.edu mem/cache/prefetch/base_prefetcher.cc 1264519Sgblack@eecs.umich.edu mem/cache/prefetch/prefetcher.cc 1274519Sgblack@eecs.umich.edu mem/cache/prefetch/tagged_prefetcher.cc 1284519Sgblack@eecs.umich.edu mem/cache/tags/base_tags.cc 1294519Sgblack@eecs.umich.edu mem/cache/tags/cache_tags.cc 1304712Sgblack@eecs.umich.edu mem/cache/tags/fa_lru.cc 1314519Sgblack@eecs.umich.edu mem/cache/tags/iic.cc 1324519Sgblack@eecs.umich.edu mem/cache/tags/lru.cc 1334519Sgblack@eecs.umich.edu mem/cache/tags/repl/gen.cc 1344519Sgblack@eecs.umich.edu mem/cache/tags/repl/repl.cc 1354712Sgblack@eecs.umich.edu mem/cache/tags/split.cc 1364519Sgblack@eecs.umich.edu mem/cache/tags/split_lru.cc 1374519Sgblack@eecs.umich.edu mem/cache/tags/split_lifo.cc 1384519Sgblack@eecs.umich.edu mem/functional/functional.cc 1394519Sgblack@eecs.umich.edu mem/timing/base_memory.cc 1404519Sgblack@eecs.umich.edu mem/timing/memory_builder.cc 1414519Sgblack@eecs.umich.edu mem/timing/simple_mem_bank.cc 1424519Sgblack@eecs.umich.edu mem/trace/itx_writer.cc 1434951Sgblack@eecs.umich.edu mem/trace/mem_trace_writer.cc 1444519Sgblack@eecs.umich.edu mem/trace/m5_writer.cc 1454519Sgblack@eecs.umich.edu 1464519Sgblack@eecs.umich.edu python/pyconfig.cc 1474519Sgblack@eecs.umich.edu python/embedded_py.cc 1484519Sgblack@eecs.umich.edu 1494951Sgblack@eecs.umich.edu sim/builder.cc 1504519Sgblack@eecs.umich.edu sim/configfile.cc 1514519Sgblack@eecs.umich.edu sim/debug.cc 1524951Sgblack@eecs.umich.edu sim/eventq.cc 1534712Sgblack@eecs.umich.edu sim/faults.cc 1544519Sgblack@eecs.umich.edu sim/main.cc 1554951Sgblack@eecs.umich.edu sim/param.cc 1564519Sgblack@eecs.umich.edu sim/profile.cc 1574951Sgblack@eecs.umich.edu sim/root.cc 1584712Sgblack@eecs.umich.edu sim/serialize.cc 1594519Sgblack@eecs.umich.edu sim/sim_events.cc 1604519Sgblack@eecs.umich.edu sim/sim_exit.cc 1614519Sgblack@eecs.umich.edu sim/sim_object.cc 1624519Sgblack@eecs.umich.edu sim/startup.cc 1634519Sgblack@eecs.umich.edu sim/stat_context.cc 1644519Sgblack@eecs.umich.edu sim/stat_control.cc 1654519Sgblack@eecs.umich.edu sim/trace_context.cc 1664519Sgblack@eecs.umich.edu ''') 1674519Sgblack@eecs.umich.edu 1684519Sgblack@eecs.umich.edu# Old FullCPU sources 1694519Sgblack@eecs.umich.edufull_cpu_sources = Split(''' 1704519Sgblack@eecs.umich.edu encumbered/cpu/full/bpred.cc 1714519Sgblack@eecs.umich.edu encumbered/cpu/full/commit.cc 1724519Sgblack@eecs.umich.edu encumbered/cpu/full/cpu.cc 1734519Sgblack@eecs.umich.edu encumbered/cpu/full/create_vector.cc 1744712Sgblack@eecs.umich.edu encumbered/cpu/full/cv_spec_state.cc 1754519Sgblack@eecs.umich.edu encumbered/cpu/full/dd_queue.cc 1764581Sgblack@eecs.umich.edu encumbered/cpu/full/dep_link.cc 1774688Sgblack@eecs.umich.edu encumbered/cpu/full/dispatch.cc 1784581Sgblack@eecs.umich.edu encumbered/cpu/full/dyn_inst.cc 1794519Sgblack@eecs.umich.edu encumbered/cpu/full/execute.cc 1804519Sgblack@eecs.umich.edu encumbered/cpu/full/fetch.cc 1814519Sgblack@eecs.umich.edu encumbered/cpu/full/floss_reasons.cc 1824519Sgblack@eecs.umich.edu encumbered/cpu/full/fu_pool.cc 1834519Sgblack@eecs.umich.edu encumbered/cpu/full/inst_fifo.cc 1844519Sgblack@eecs.umich.edu encumbered/cpu/full/instpipe.cc 1854519Sgblack@eecs.umich.edu encumbered/cpu/full/issue.cc 1864519Sgblack@eecs.umich.edu encumbered/cpu/full/ls_queue.cc 1874712Sgblack@eecs.umich.edu encumbered/cpu/full/machine_queue.cc 1884519Sgblack@eecs.umich.edu encumbered/cpu/full/pipetrace.cc 1894581Sgblack@eecs.umich.edu encumbered/cpu/full/readyq.cc 1904688Sgblack@eecs.umich.edu encumbered/cpu/full/reg_info.cc 1914581Sgblack@eecs.umich.edu encumbered/cpu/full/rob_station.cc 1924519Sgblack@eecs.umich.edu encumbered/cpu/full/spec_memory.cc 1934519Sgblack@eecs.umich.edu encumbered/cpu/full/spec_state.cc 1944519Sgblack@eecs.umich.edu encumbered/cpu/full/storebuffer.cc 1954519Sgblack@eecs.umich.edu encumbered/cpu/full/writeback.cc 1964519Sgblack@eecs.umich.edu encumbered/cpu/full/iq/iq_station.cc 1974519Sgblack@eecs.umich.edu encumbered/cpu/full/iq/iqueue.cc 1984519Sgblack@eecs.umich.edu encumbered/cpu/full/iq/segmented/chain_info.cc 1994951Sgblack@eecs.umich.edu encumbered/cpu/full/iq/segmented/chain_wire.cc 2004519Sgblack@eecs.umich.edu encumbered/cpu/full/iq/segmented/iq_seg.cc 2014519Sgblack@eecs.umich.edu encumbered/cpu/full/iq/segmented/iq_segmented.cc 2024519Sgblack@eecs.umich.edu encumbered/cpu/full/iq/segmented/seg_chain.cc 2034519Sgblack@eecs.umich.edu encumbered/cpu/full/iq/seznec/iq_seznec.cc 2044951Sgblack@eecs.umich.edu encumbered/cpu/full/iq/standard/iq_standard.cc 2054519Sgblack@eecs.umich.edu ''') 2064951Sgblack@eecs.umich.edu 2074712Sgblack@eecs.umich.edu# MySql sources 2084519Sgblack@eecs.umich.edumysql_sources = Split(''' 2094581Sgblack@eecs.umich.edu base/mysql.cc 2104688Sgblack@eecs.umich.edu base/stats/mysql.cc 2114581Sgblack@eecs.umich.edu ''') 2124519Sgblack@eecs.umich.edu 2134519Sgblack@eecs.umich.edu# Full-system sources 2144519Sgblack@eecs.umich.edufull_system_sources = Split(''' 2154519Sgblack@eecs.umich.edu arch/alpha/freebsd/system.cc 2164951Sgblack@eecs.umich.edu arch/alpha/linux/system.cc 2174519Sgblack@eecs.umich.edu arch/alpha/system.cc 2184519Sgblack@eecs.umich.edu arch/alpha/tru64/system.cc 2194951Sgblack@eecs.umich.edu 2204712Sgblack@eecs.umich.edu base/crc.cc 2214519Sgblack@eecs.umich.edu base/inet.cc 2224581Sgblack@eecs.umich.edu base/remote_gdb.cc 2234688Sgblack@eecs.umich.edu 2244581Sgblack@eecs.umich.edu cpu/intr_control.cc 2254519Sgblack@eecs.umich.edu cpu/profile.cc 2264519Sgblack@eecs.umich.edu 2274519Sgblack@eecs.umich.edu dev/alpha_console.cc 2284519Sgblack@eecs.umich.edu dev/baddev.cc 2294519Sgblack@eecs.umich.edu dev/simconsole.cc 2305075Sgblack@eecs.umich.edu dev/disk_image.cc 2315075Sgblack@eecs.umich.edu dev/etherbus.cc 2325075Sgblack@eecs.umich.edu dev/etherdump.cc 2335075Sgblack@eecs.umich.edu dev/etherint.cc 2345075Sgblack@eecs.umich.edu dev/etherlink.cc 2355075Sgblack@eecs.umich.edu dev/etherpkt.cc 2365075Sgblack@eecs.umich.edu dev/ethertap.cc 2375075Sgblack@eecs.umich.edu dev/ide_ctrl.cc 2385075Sgblack@eecs.umich.edu dev/ide_disk.cc 2395075Sgblack@eecs.umich.edu dev/io_device.cc 2405075Sgblack@eecs.umich.edu dev/ns_gige.cc 2415075Sgblack@eecs.umich.edu dev/pciconfigall.cc 2425075Sgblack@eecs.umich.edu dev/pcidev.cc 2435075Sgblack@eecs.umich.edu dev/pcifake.cc 2445075Sgblack@eecs.umich.edu dev/pktfifo.cc 2455075Sgblack@eecs.umich.edu dev/platform.cc 2465075Sgblack@eecs.umich.edu dev/sinic.cc 2475075Sgblack@eecs.umich.edu dev/simple_disk.cc 2485075Sgblack@eecs.umich.edu dev/tsunami.cc 2495075Sgblack@eecs.umich.edu dev/tsunami_cchip.cc 2505075Sgblack@eecs.umich.edu dev/isa_fake.cc 2515075Sgblack@eecs.umich.edu dev/tsunami_io.cc 2525075Sgblack@eecs.umich.edu dev/tsunami_pchip.cc 2535075Sgblack@eecs.umich.edu dev/uart.cc 2545075Sgblack@eecs.umich.edu dev/uart8250.cc 2555075Sgblack@eecs.umich.edu 2565075Sgblack@eecs.umich.edu kern/kernel_binning.cc 2575075Sgblack@eecs.umich.edu kern/kernel_stats.cc 2585075Sgblack@eecs.umich.edu kern/system_events.cc 2595075Sgblack@eecs.umich.edu kern/linux/events.cc 2605075Sgblack@eecs.umich.edu kern/linux/linux_syscalls.cc 2615075Sgblack@eecs.umich.edu kern/linux/printk.cc 2625075Sgblack@eecs.umich.edu kern/tru64/dump_mbuf.cc 2635075Sgblack@eecs.umich.edu kern/tru64/printf.cc 2645075Sgblack@eecs.umich.edu kern/tru64/tru64_events.cc 2655075Sgblack@eecs.umich.edu kern/tru64/tru64_syscalls.cc 2665075Sgblack@eecs.umich.edu 2675075Sgblack@eecs.umich.edu mem/functional/memory_control.cc 2685075Sgblack@eecs.umich.edu mem/functional/physical.cc 2694519Sgblack@eecs.umich.edu 2705040Sgblack@eecs.umich.edu sim/system.cc 2715040Sgblack@eecs.umich.edu sim/pseudo_inst.cc 2725040Sgblack@eecs.umich.edu ''') 2735040Sgblack@eecs.umich.edu 2745040Sgblack@eecs.umich.edu# turbolaser encumbered sources 2755040Sgblack@eecs.umich.eduturbolaser_sources = Split(''' 2765040Sgblack@eecs.umich.edu encumbered/dev/dma.cc 2775040Sgblack@eecs.umich.edu encumbered/dev/etherdev.cc 2785040Sgblack@eecs.umich.edu encumbered/dev/scsi.cc 2795040Sgblack@eecs.umich.edu encumbered/dev/scsi_ctrl.cc 2805040Sgblack@eecs.umich.edu encumbered/dev/scsi_disk.cc 2815040Sgblack@eecs.umich.edu encumbered/dev/scsi_none.cc 2825040Sgblack@eecs.umich.edu encumbered/dev/tlaser_clock.cc 2835040Sgblack@eecs.umich.edu encumbered/dev/tlaser_ipi.cc 2845040Sgblack@eecs.umich.edu encumbered/dev/tlaser_mbox.cc 2855040Sgblack@eecs.umich.edu encumbered/dev/tlaser_mc146818.cc 2865040Sgblack@eecs.umich.edu encumbered/dev/tlaser_node.cc 2875040Sgblack@eecs.umich.edu encumbered/dev/tlaser_pcia.cc 2885040Sgblack@eecs.umich.edu encumbered/dev/tlaser_pcidev.cc 2895040Sgblack@eecs.umich.edu encumbered/dev/tlaser_serial.cc 2905040Sgblack@eecs.umich.edu encumbered/dev/turbolaser.cc 2915040Sgblack@eecs.umich.edu encumbered/dev/uart8530.cc 2925040Sgblack@eecs.umich.edu ''') 2935040Sgblack@eecs.umich.edu 2945040Sgblack@eecs.umich.edu# Syscall emulation (non-full-system) sources 2955040Sgblack@eecs.umich.edusyscall_emulation_sources = Split(''' 2965040Sgblack@eecs.umich.edu cpu/memtest/memtest.cc 2975040Sgblack@eecs.umich.edu encumbered/eio/eio.cc 2985040Sgblack@eecs.umich.edu encumbered/eio/exolex.cc 2995040Sgblack@eecs.umich.edu encumbered/eio/libexo.cc 3005062Sgblack@eecs.umich.edu kern/linux/linux.cc 3015062Sgblack@eecs.umich.edu kern/tru64/tru64.cc 3025062Sgblack@eecs.umich.edu sim/process.cc 3035062Sgblack@eecs.umich.edu sim/syscall_emul.cc 3045062Sgblack@eecs.umich.edu ''') 3055062Sgblack@eecs.umich.edu 3065062Sgblack@eecs.umich.edu# The following stuff (targetarch code and global define of THE_ISA) 3075040Sgblack@eecs.umich.edu# are legacy things that assume we're only compiling one ISA at a 3085062Sgblack@eecs.umich.edu# time. These will have to go away if we want to build a binary that 3095062Sgblack@eecs.umich.edu# supports multiple ISAs. 3105062Sgblack@eecs.umich.edu 3115062Sgblack@eecs.umich.edu#targetarch_files = Split(''' 3125040Sgblack@eecs.umich.edu# alpha_linux_process.hh 3135040Sgblack@eecs.umich.edu# alpha_memory.hh 3145040Sgblack@eecs.umich.edu# alpha_tru64_process.hh 3155040Sgblack@eecs.umich.edu# aout_machdep.h 3165040Sgblack@eecs.umich.edu# arguments.hh 3175040Sgblack@eecs.umich.edu# ecoff_machdep.h 3185040Sgblack@eecs.umich.edu# ev5.hh 3195040Sgblack@eecs.umich.edu# faults.hh 3205040Sgblack@eecs.umich.edu# stacktrace.hh 3215239Sgblack@eecs.umich.edu# vtophys.hh 3225040Sgblack@eecs.umich.edu# ''') 3235040Sgblack@eecs.umich.edu 3245040Sgblack@eecs.umich.edu# Set up bridging headers to the architecture specific versions 3255040Sgblack@eecs.umich.edu#for f in targetarch_files: 3265040Sgblack@eecs.umich.edu# env.Command('targetarch/' + f, 'arch/%s/%s' % (env['TARGET_ISA'], f), 3275040Sgblack@eecs.umich.edu# '''echo '#include "arch/%s/%s"' > $TARGET''' % (env['TARGET_ISA'], f)) 3285040Sgblack@eecs.umich.edu 3295040Sgblack@eecs.umich.edu# Add a flag defining what THE_ISA should be for all compilation 3305061Sgblack@eecs.umich.eduenv.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())]) 3315040Sgblack@eecs.umich.edu 3325040Sgblack@eecs.umich.eduarch_sources = SConscript('arch/SConscript', 3335061Sgblack@eecs.umich.edu exports = 'env', duplicate = False) 3345061Sgblack@eecs.umich.edu 3355061Sgblack@eecs.umich.educpu_sources = SConscript('cpu/SConscript', 3365061Sgblack@eecs.umich.edu exports = 'env', duplicate = False) 3375061Sgblack@eecs.umich.edu 3385061Sgblack@eecs.umich.edu# This is outside of cpu/SConscript since the source directory isn't 3395061Sgblack@eecs.umich.edu# underneath 'cpu'. 3405061Sgblack@eecs.umich.eduif 'FullCPU' in env['CPU_MODELS']: 3415040Sgblack@eecs.umich.edu cpu_sources += full_cpu_sources 3425040Sgblack@eecs.umich.edu 3435040Sgblack@eecs.umich.edu# Set up complete list of sources based on configuration. 3445040Sgblack@eecs.umich.edusources = base_sources + arch_sources + cpu_sources 3455040Sgblack@eecs.umich.edu 3465040Sgblack@eecs.umich.eduif env['FULL_SYSTEM']: 3475040Sgblack@eecs.umich.edu sources += full_system_sources 3485040Sgblack@eecs.umich.edu if env['ALPHA_TLASER']: 3495040Sgblack@eecs.umich.edu sources += turbolaser_sources 3505040Sgblack@eecs.umich.eduelse: 3515040Sgblack@eecs.umich.edu sources += syscall_emulation_sources 3525040Sgblack@eecs.umich.edu 3535040Sgblack@eecs.umich.eduif env['USE_MYSQL']: 3545040Sgblack@eecs.umich.edu sources += mysql_sources 3555040Sgblack@eecs.umich.edu 3565040Sgblack@eecs.umich.edufor opt in env.ExportOptions: 3575040Sgblack@eecs.umich.edu env.ConfigFile(opt) 3585040Sgblack@eecs.umich.edu 3595040Sgblack@eecs.umich.edu################################################### 3605040Sgblack@eecs.umich.edu# 3615040Sgblack@eecs.umich.edu# Special build rules. 3625040Sgblack@eecs.umich.edu# 3635040Sgblack@eecs.umich.edu################################################### 3645040Sgblack@eecs.umich.edu 3655040Sgblack@eecs.umich.edu# base/traceflags.{cc,hh} are generated from base/traceflags.py. 3664688Sgblack@eecs.umich.edu# $TARGET.base will expand to "<build-dir>/base/traceflags". 3675040Sgblack@eecs.umich.eduenv.Command(Split('base/traceflags.hh base/traceflags.cc'), 3684688Sgblack@eecs.umich.edu 'base/traceflags.py', 3694688Sgblack@eecs.umich.edu 'python $SOURCE $TARGET.base') 3704688Sgblack@eecs.umich.edu 3714688Sgblack@eecs.umich.edu# libelf build is described in its own SConscript file. 3725040Sgblack@eecs.umich.edu# SConscript-local is the per-config build, which just copies some 3734688Sgblack@eecs.umich.edu# header files into a place where they can be found. 3745040Sgblack@eecs.umich.eduSConscript('libelf/SConscript-local', exports = 'env', duplicate=0) 3755040Sgblack@eecs.umich.eduSConscript('python/SConscript', exports = ['env'], duplicate=0) 3765040Sgblack@eecs.umich.edu 3775040Sgblack@eecs.umich.edu# This function adds the specified sources to the given build 3785040Sgblack@eecs.umich.edu# environment, and returns a list of all the corresponding SCons 3795040Sgblack@eecs.umich.edu# Object nodes (including an extra one for date.cc). We explicitly 3805040Sgblack@eecs.umich.edu# add the Object nodes so we can set up special dependencies for 3815040Sgblack@eecs.umich.edu# date.cc. 3825040Sgblack@eecs.umich.edudef make_objs(sources, env): 3835040Sgblack@eecs.umich.edu objs = [env.Object(s) for s in sources] 3845040Sgblack@eecs.umich.edu # make date.cc depend on all other objects so it always gets 3855040Sgblack@eecs.umich.edu # recompiled whenever anything else does 3865040Sgblack@eecs.umich.edu date_obj = env.Object('base/date.cc') 3875040Sgblack@eecs.umich.edu env.Depends(date_obj, objs) 3885040Sgblack@eecs.umich.edu objs.append(date_obj) 3895040Sgblack@eecs.umich.edu return objs 3905040Sgblack@eecs.umich.edu 3915040Sgblack@eecs.umich.edu################################################### 3925040Sgblack@eecs.umich.edu# 3935040Sgblack@eecs.umich.edu# Define binaries. Each different build type (debug, opt, etc.) gets 3945040Sgblack@eecs.umich.edu# a slightly different build environment. 3955040Sgblack@eecs.umich.edu# 3964688Sgblack@eecs.umich.edu################################################### 3974688Sgblack@eecs.umich.edu 3985040Sgblack@eecs.umich.edu# Include file paths are rooted in this directory. SCons will 3995040Sgblack@eecs.umich.edu# automatically expand '.' to refer to both the source directory and 4005040Sgblack@eecs.umich.edu# the corresponding build directory to pick up generated include 4015040Sgblack@eecs.umich.edu# files. 4024688Sgblack@eecs.umich.eduenv.Append(CPPPATH='.') 4034688Sgblack@eecs.umich.edu 4045040Sgblack@eecs.umich.edu# Debug binary 4055040Sgblack@eecs.umich.edudebugEnv = env.Copy(OBJSUFFIX='.do') 4065040Sgblack@eecs.umich.edudebugEnv.Label = 'debug' 4075040Sgblack@eecs.umich.edudebugEnv.Append(CCFLAGS=Split('-g -gstabs+ -O0')) 4085040Sgblack@eecs.umich.edudebugEnv.Append(CPPDEFINES='DEBUG') 4095040Sgblack@eecs.umich.edutlist = debugEnv.Program(target = 'm5.debug', 4104519Sgblack@eecs.umich.edu source = make_objs(sources, debugEnv)) 4114519Sgblack@eecs.umich.edudebugEnv.M5Binary = tlist[0] 4125040Sgblack@eecs.umich.edu 4134688Sgblack@eecs.umich.edu# Optimized binary 4144701Sgblack@eecs.umich.eduoptEnv = env.Copy() 4154688Sgblack@eecs.umich.eduoptEnv.Label = 'opt' 4164688Sgblack@eecs.umich.eduoptEnv.Append(CCFLAGS=Split('-g -O5')) 4174688Sgblack@eecs.umich.edutlist = optEnv.Program(target = 'm5.opt', 4184688Sgblack@eecs.umich.edu source = make_objs(sources, optEnv)) 4194688Sgblack@eecs.umich.eduoptEnv.M5Binary = tlist[0] 4204688Sgblack@eecs.umich.edu 4214688Sgblack@eecs.umich.edu# "Fast" binary 4224519Sgblack@eecs.umich.edufastEnv = env.Copy(OBJSUFFIX='.fo') 4234519Sgblack@eecs.umich.edufastEnv.Label = 'fast' 4245040Sgblack@eecs.umich.edufastEnv.Append(CCFLAGS=Split('-O5')) 4255040Sgblack@eecs.umich.edufastEnv.Append(CPPDEFINES='NDEBUG') 4265040Sgblack@eecs.umich.edufastEnv.Program(target = 'm5.fast.unstripped', 4274560Sgblack@eecs.umich.edu source = make_objs(sources, fastEnv)) 4285040Sgblack@eecs.umich.edutlist = fastEnv.Command(target = 'm5.fast', 4294688Sgblack@eecs.umich.edu source = 'm5.fast.unstripped', 4305040Sgblack@eecs.umich.edu action = 'strip $SOURCE -o $TARGET') 4314519Sgblack@eecs.umich.edufastEnv.M5Binary = tlist[0] 4325040Sgblack@eecs.umich.edu 4334519Sgblack@eecs.umich.edu# Profiled binary 4344519Sgblack@eecs.umich.eduprofEnv = env.Copy(OBJSUFFIX='.po') 4354519Sgblack@eecs.umich.eduprofEnv.Label = 'prof' 4364539Sgblack@eecs.umich.eduprofEnv.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg') 4374519Sgblack@eecs.umich.edutlist = profEnv.Program(target = 'm5.prof', 4385040Sgblack@eecs.umich.edu source = make_objs(sources, profEnv)) 4394688Sgblack@eecs.umich.eduprofEnv.M5Binary = tlist[0] 4405040Sgblack@eecs.umich.edu 4415040Sgblack@eecs.umich.eduenvList = [debugEnv, optEnv, fastEnv, profEnv] 4425115Sgblack@eecs.umich.edu 4435040Sgblack@eecs.umich.eduReturn('envList') 4445040Sgblack@eecs.umich.edu