SConscript revision 1858
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 3112563Sgabeblack@google.comfrom os.path import isdir 3212563Sgabeblack@google.com 335522Snate@binkert.org# This file defines how to build a particular configuration of M5 346143Snate@binkert.org# based on variable settings in the 'env' build environment. 3512371Sgabeblack@google.com 364762Snate@binkert.org# Import build environment variable from SConstruct. 375522Snate@binkert.orgImport('env') 38955SN/A 395522Snate@binkert.org################################################### 4011974Sgabeblack@google.com# 41955SN/A# Define needed sources. 425522Snate@binkert.org# 434202Sbinkertn@umich.edu################################################### 445742Snate@binkert.org 45955SN/A# Base sources used by all configurations. 464381Sbinkertn@umich.edubase_sources = Split(''' 474381Sbinkertn@umich.edu arch/alpha/decoder.cc 4812246Sgabeblack@google.com arch/alpha/alpha_o3_exec.cc 4912246Sgabeblack@google.com arch/alpha/fast_cpu_exec.cc 508334Snate@binkert.org arch/alpha/simple_cpu_exec.cc 51955SN/A arch/alpha/full_cpu_exec.cc 52955SN/A arch/alpha/faults.cc 534202Sbinkertn@umich.edu arch/alpha/isa_traits.cc 54955SN/A 554382Sbinkertn@umich.edu base/circlebuf.cc 564382Sbinkertn@umich.edu base/copyright.cc 574382Sbinkertn@umich.edu base/cprintf.cc 586654Snate@binkert.org base/embedfile.cc 595517Snate@binkert.org base/fast_alloc.cc 608614Sgblack@eecs.umich.edu base/fifo_buffer.cc 617674Snate@binkert.org base/hostinfo.cc 626143Snate@binkert.org base/hybrid_pred.cc 636143Snate@binkert.org base/inifile.cc 646143Snate@binkert.org base/intmath.cc 6512302Sgabeblack@google.com base/match.cc 6612302Sgabeblack@google.com base/misc.cc 6712302Sgabeblack@google.com base/output.cc 6812371Sgabeblack@google.com base/pollevent.cc 6912371Sgabeblack@google.com base/range.cc 7012371Sgabeblack@google.com base/random.cc 7112371Sgabeblack@google.com base/sat_counter.cc 7212371Sgabeblack@google.com base/socket.cc 7312371Sgabeblack@google.com base/statistics.cc 7412371Sgabeblack@google.com base/str.cc 7512371Sgabeblack@google.com base/time.cc 7612371Sgabeblack@google.com base/trace.cc 7712371Sgabeblack@google.com base/traceflags.cc 7812371Sgabeblack@google.com base/userinfo.cc 7912371Sgabeblack@google.com base/compression/lzss_compression.cc 8012371Sgabeblack@google.com base/loader/aout_object.cc 8112371Sgabeblack@google.com base/loader/ecoff_object.cc 8212371Sgabeblack@google.com base/loader/elf_object.cc 8312371Sgabeblack@google.com base/loader/object_file.cc 8412371Sgabeblack@google.com base/loader/symtab.cc 8512371Sgabeblack@google.com base/stats/events.cc 8612371Sgabeblack@google.com base/stats/statdb.cc 8712371Sgabeblack@google.com base/stats/visit.cc 8812371Sgabeblack@google.com base/stats/text.cc 8912371Sgabeblack@google.com 9012371Sgabeblack@google.com cpu/base.cc 9112371Sgabeblack@google.com cpu/base_dyn_inst.cc 9212371Sgabeblack@google.com cpu/exec_context.cc 9312371Sgabeblack@google.com cpu/exetrace.cc 9412371Sgabeblack@google.com cpu/pc_event.cc 9512371Sgabeblack@google.com cpu/static_inst.cc 9612371Sgabeblack@google.com cpu/o3/2bit_local_pred.cc 9712371Sgabeblack@google.com cpu/o3/alpha_dyn_inst.cc 9812371Sgabeblack@google.com cpu/o3/alpha_cpu.cc 9912371Sgabeblack@google.com cpu/o3/alpha_cpu_builder.cc 10012371Sgabeblack@google.com cpu/o3/bpred_unit.cc 10112371Sgabeblack@google.com cpu/o3/btb.cc 10212371Sgabeblack@google.com cpu/o3/commit.cc 10312371Sgabeblack@google.com cpu/o3/decode.cc 10412371Sgabeblack@google.com cpu/o3/fetch.cc 10512371Sgabeblack@google.com cpu/o3/free_list.cc 10612371Sgabeblack@google.com cpu/o3/cpu.cc 10712371Sgabeblack@google.com cpu/o3/iew.cc 10812371Sgabeblack@google.com cpu/o3/inst_queue.cc 10912371Sgabeblack@google.com cpu/o3/ldstq.cc 11012371Sgabeblack@google.com cpu/o3/mem_dep_unit.cc 11112371Sgabeblack@google.com cpu/o3/ras.cc 11212371Sgabeblack@google.com cpu/o3/rename.cc 11312371Sgabeblack@google.com cpu/o3/rename_map.cc 11412371Sgabeblack@google.com cpu/o3/rob.cc 11512302Sgabeblack@google.com cpu/o3/sat_counter.cc 11612371Sgabeblack@google.com cpu/o3/store_set.cc 11712302Sgabeblack@google.com cpu/o3/tournament_pred.cc 11812371Sgabeblack@google.com cpu/fast/cpu.cc 11912302Sgabeblack@google.com cpu/sampler/sampler.cc 12012302Sgabeblack@google.com cpu/simple/cpu.cc 12112371Sgabeblack@google.com cpu/trace/reader/mem_trace_reader.cc 12212371Sgabeblack@google.com cpu/trace/reader/ibm_reader.cc 12312371Sgabeblack@google.com cpu/trace/reader/itx_reader.cc 12412371Sgabeblack@google.com cpu/trace/reader/m5_reader.cc 12512302Sgabeblack@google.com cpu/trace/opt_cpu.cc 12612371Sgabeblack@google.com cpu/trace/trace_cpu.cc 12712371Sgabeblack@google.com 12812371Sgabeblack@google.com encumbered/cpu/full/bpred.cc 12912371Sgabeblack@google.com encumbered/cpu/full/commit.cc 13011983Sgabeblack@google.com encumbered/cpu/full/cpu.cc 1316143Snate@binkert.org encumbered/cpu/full/create_vector.cc 1328233Snate@binkert.org encumbered/cpu/full/cv_spec_state.cc 13312302Sgabeblack@google.com encumbered/cpu/full/dd_queue.cc 1346143Snate@binkert.org encumbered/cpu/full/dep_link.cc 1356143Snate@binkert.org encumbered/cpu/full/dispatch.cc 13612302Sgabeblack@google.com encumbered/cpu/full/dyn_inst.cc 1374762Snate@binkert.org encumbered/cpu/full/execute.cc 1386143Snate@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 14112302Sgabeblack@google.com encumbered/cpu/full/inst_fifo.cc 14212302Sgabeblack@google.com encumbered/cpu/full/instpipe.cc 1436143Snate@binkert.org encumbered/cpu/full/issue.cc 14412362Sgabeblack@google.com encumbered/cpu/full/ls_queue.cc 14512362Sgabeblack@google.com encumbered/cpu/full/machine_queue.cc 14612362Sgabeblack@google.com encumbered/cpu/full/pc_sample_profile.cc 14712362Sgabeblack@google.com encumbered/cpu/full/pipetrace.cc 14812302Sgabeblack@google.com encumbered/cpu/full/readyq.cc 14912302Sgabeblack@google.com encumbered/cpu/full/reg_info.cc 15012302Sgabeblack@google.com encumbered/cpu/full/rob_station.cc 15112302Sgabeblack@google.com encumbered/cpu/full/spec_memory.cc 15212302Sgabeblack@google.com encumbered/cpu/full/spec_state.cc 15312363Sgabeblack@google.com encumbered/cpu/full/storebuffer.cc 15412363Sgabeblack@google.com encumbered/cpu/full/writeback.cc 15512363Sgabeblack@google.com encumbered/cpu/full/iq/iq_station.cc 15612363Sgabeblack@google.com encumbered/cpu/full/iq/iqueue.cc 15712302Sgabeblack@google.com encumbered/cpu/full/iq/segmented/chain_info.cc 15812363Sgabeblack@google.com encumbered/cpu/full/iq/segmented/chain_wire.cc 15912363Sgabeblack@google.com encumbered/cpu/full/iq/segmented/iq_seg.cc 16012363Sgabeblack@google.com encumbered/cpu/full/iq/segmented/iq_segmented.cc 16112363Sgabeblack@google.com encumbered/cpu/full/iq/segmented/seg_chain.cc 16212363Sgabeblack@google.com encumbered/cpu/full/iq/seznec/iq_seznec.cc 1638233Snate@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 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 1737065Snate@binkert.org mem/bus/base_interface.cc 1746143Snate@binkert.org mem/bus/bus.cc 17512362Sgabeblack@google.com mem/bus/bus_bridge.cc 17612362Sgabeblack@google.com mem/bus/bus_bridge_master.cc 17712362Sgabeblack@google.com mem/bus/bus_bridge_slave.cc 17812362Sgabeblack@google.com mem/bus/bus_interface.cc 17912362Sgabeblack@google.com mem/bus/dma_bus_interface.cc 18012362Sgabeblack@google.com mem/bus/dma_interface.cc 18112362Sgabeblack@google.com mem/bus/master_interface.cc 18212362Sgabeblack@google.com mem/bus/slave_interface.cc 18312362Sgabeblack@google.com mem/cache/base_cache.cc 18412362Sgabeblack@google.com mem/cache/cache.cc 18512362Sgabeblack@google.com mem/cache/cache_builder.cc 18612362Sgabeblack@google.com mem/cache/coherence/coherence_protocol.cc 1878233Snate@binkert.org mem/cache/coherence/uni_coherence.cc 1888233Snate@binkert.org mem/cache/miss/blocking_buffer.cc 1898233Snate@binkert.org mem/cache/miss/miss_queue.cc 1908233Snate@binkert.org mem/cache/miss/mshr.cc 1918233Snate@binkert.org mem/cache/miss/mshr_queue.cc 1928233Snate@binkert.org mem/cache/prefetch/base_prefetcher.cc 1938233Snate@binkert.org mem/cache/prefetch/prefetcher.cc 1948233Snate@binkert.org mem/cache/prefetch/tagged_prefetcher.cc 1958233Snate@binkert.org mem/cache/tags/base_tags.cc 1968233Snate@binkert.org mem/cache/tags/cache_tags.cc 1978233Snate@binkert.org mem/cache/tags/fa_lru.cc 1988233Snate@binkert.org mem/cache/tags/iic.cc 1998233Snate@binkert.org mem/cache/tags/lru.cc 2008233Snate@binkert.org mem/cache/tags/repl/gen.cc 2018233Snate@binkert.org mem/cache/tags/repl/repl.cc 2028233Snate@binkert.org mem/functional/functional.cc 2038233Snate@binkert.org mem/timing/base_memory.cc 2048233Snate@binkert.org mem/timing/memory_builder.cc 2058233Snate@binkert.org mem/timing/simple_mem_bank.cc 2068233Snate@binkert.org mem/trace/itx_writer.cc 2078233Snate@binkert.org mem/trace/mem_trace_writer.cc 2086143Snate@binkert.org mem/trace/m5_writer.cc 2096143Snate@binkert.org 2106143Snate@binkert.org python/pyconfig.cc 2116143Snate@binkert.org python/embedded_py.cc 2126143Snate@binkert.org 2136143Snate@binkert.org sim/builder.cc 2149982Satgutier@umich.edu sim/configfile.cc 2156143Snate@binkert.org sim/debug.cc 21612302Sgabeblack@google.com sim/eventq.cc 21712302Sgabeblack@google.com sim/main.cc 21812302Sgabeblack@google.com sim/param.cc 21912302Sgabeblack@google.com sim/profile.cc 22012302Sgabeblack@google.com sim/root.cc 22112302Sgabeblack@google.com sim/serialize.cc 22212302Sgabeblack@google.com sim/sim_events.cc 22312302Sgabeblack@google.com sim/sim_exit.cc 22411983Sgabeblack@google.com sim/sim_object.cc 22511983Sgabeblack@google.com sim/startup.cc 22611983Sgabeblack@google.com sim/stat_context.cc 22712302Sgabeblack@google.com sim/stat_control.cc 22812302Sgabeblack@google.com sim/trace_context.cc 22912302Sgabeblack@google.com ''') 23012302Sgabeblack@google.com 23112302Sgabeblack@google.com# MySql sources 23212302Sgabeblack@google.commysql_sources = Split(''' 23311983Sgabeblack@google.com base/mysql.cc 2346143Snate@binkert.org base/stats/mysql.cc 23512305Sgabeblack@google.com ''') 23612302Sgabeblack@google.com 23712302Sgabeblack@google.com# Full-system sources 23812302Sgabeblack@google.comfull_system_sources = Split(''' 2396143Snate@binkert.org arch/alpha/alpha_memory.cc 2406143Snate@binkert.org arch/alpha/arguments.cc 2416143Snate@binkert.org arch/alpha/ev5.cc 2425522Snate@binkert.org arch/alpha/osfpal.cc 2436143Snate@binkert.org arch/alpha/pseudo_inst.cc 2446143Snate@binkert.org arch/alpha/vtophys.cc 2456143Snate@binkert.org 2469982Satgutier@umich.edu base/crc.cc 24712302Sgabeblack@google.com base/inet.cc 24812302Sgabeblack@google.com base/remote_gdb.cc 24912302Sgabeblack@google.com 2506143Snate@binkert.org cpu/intr_control.cc 2516143Snate@binkert.org 2526143Snate@binkert.org dev/alpha_console.cc 2536143Snate@binkert.org dev/baddev.cc 2545522Snate@binkert.org dev/simconsole.cc 2555522Snate@binkert.org dev/disk_image.cc 2565522Snate@binkert.org dev/etherbus.cc 2575522Snate@binkert.org dev/etherdump.cc 2585604Snate@binkert.org dev/etherint.cc 2595604Snate@binkert.org dev/etherlink.cc 2606143Snate@binkert.org dev/etherpkt.cc 2616143Snate@binkert.org dev/ethertap.cc 2624762Snate@binkert.org dev/ide_ctrl.cc 2634762Snate@binkert.org dev/ide_disk.cc 2646143Snate@binkert.org dev/io_device.cc 2656727Ssteve.reinhardt@amd.com dev/ns_gige.cc 2666727Ssteve.reinhardt@amd.com dev/pciconfigall.cc 2676727Ssteve.reinhardt@amd.com dev/pcidev.cc 2684762Snate@binkert.org dev/pcifake.cc 2696143Snate@binkert.org dev/pktfifo.cc 2706143Snate@binkert.org dev/platform.cc 2716143Snate@binkert.org dev/sinic.cc 2726143Snate@binkert.org dev/simple_disk.cc 2736727Ssteve.reinhardt@amd.com dev/tsunami.cc 2746143Snate@binkert.org dev/tsunami_cchip.cc 2757674Snate@binkert.org dev/isa_fake.cc 2767674Snate@binkert.org dev/tsunami_io.cc 2775604Snate@binkert.org dev/tsunami_pchip.cc 2786143Snate@binkert.org dev/uart.cc 2796143Snate@binkert.org dev/uart8250.cc 2806143Snate@binkert.org 2814762Snate@binkert.org kern/kernel_binning.cc 2826143Snate@binkert.org kern/kernel_stats.cc 2834762Snate@binkert.org kern/system_events.cc 2844762Snate@binkert.org kern/freebsd/freebsd_system.cc 2854762Snate@binkert.org kern/freebsd/freebsd_events.cc 2866143Snate@binkert.org kern/linux/linux_events.cc 2876143Snate@binkert.org kern/linux/linux_syscalls.cc 2884762Snate@binkert.org kern/linux/linux_system.cc 28912302Sgabeblack@google.com kern/linux/printk.cc 29012302Sgabeblack@google.com kern/tru64/dump_mbuf.cc 2918233Snate@binkert.org kern/tru64/printf.cc 29212302Sgabeblack@google.com kern/tru64/tru64_events.cc 2936143Snate@binkert.org kern/tru64/tru64_syscalls.cc 2946143Snate@binkert.org kern/tru64/tru64_system.cc 2954762Snate@binkert.org 2966143Snate@binkert.org mem/functional/memory_control.cc 2974762Snate@binkert.org mem/functional/physical.cc 2989396Sandreas.hansson@arm.com 2999396Sandreas.hansson@arm.com sim/system.cc 3009396Sandreas.hansson@arm.com ''') 30112302Sgabeblack@google.com 30212302Sgabeblack@google.com# turbolaser encumbered sources 30312302Sgabeblack@google.comturbolaser_sources = Split(''' 3049396Sandreas.hansson@arm.com encumbered/dev/dma.cc 3059396Sandreas.hansson@arm.com encumbered/dev/etherdev.cc 3069396Sandreas.hansson@arm.com encumbered/dev/scsi.cc 3079396Sandreas.hansson@arm.com encumbered/dev/scsi_ctrl.cc 3089396Sandreas.hansson@arm.com encumbered/dev/scsi_disk.cc 3099396Sandreas.hansson@arm.com encumbered/dev/scsi_none.cc 3109396Sandreas.hansson@arm.com encumbered/dev/tlaser_clock.cc 3119930Sandreas.hansson@arm.com encumbered/dev/tlaser_ipi.cc 3129930Sandreas.hansson@arm.com encumbered/dev/tlaser_mbox.cc 3139396Sandreas.hansson@arm.com encumbered/dev/tlaser_mc146818.cc 3146143Snate@binkert.org encumbered/dev/tlaser_node.cc 31512797Sgabeblack@google.com encumbered/dev/tlaser_pcia.cc 31612797Sgabeblack@google.com encumbered/dev/tlaser_pcidev.cc 31712797Sgabeblack@google.com encumbered/dev/tlaser_serial.cc 3188235Snate@binkert.org encumbered/dev/turbolaser.cc 31912797Sgabeblack@google.com encumbered/dev/uart8530.cc 32012797Sgabeblack@google.com ''') 32112797Sgabeblack@google.com 32212797Sgabeblack@google.com# Syscall emulation (non-full-system) sources 32312797Sgabeblack@google.comsyscall_emulation_sources = Split(''' 32412797Sgabeblack@google.com arch/alpha/alpha_common_syscall_emul.cc 32512797Sgabeblack@google.com arch/alpha/alpha_linux_process.cc 32612797Sgabeblack@google.com arch/alpha/alpha_tru64_process.cc 32712797Sgabeblack@google.com cpu/memtest/memtest.cc 32812797Sgabeblack@google.com encumbered/eio/eio.cc 32912797Sgabeblack@google.com encumbered/eio/exolex.cc 33012797Sgabeblack@google.com encumbered/eio/libexo.cc 33112797Sgabeblack@google.com sim/process.cc 33212797Sgabeblack@google.com sim/syscall_emul.cc 33312797Sgabeblack@google.com ''') 33412757Sgabeblack@google.com 33512757Sgabeblack@google.comtargetarch_files = Split(''' 33612797Sgabeblack@google.com alpha_common_syscall_emul.hh 33712797Sgabeblack@google.com alpha_linux_process.hh 33812797Sgabeblack@google.com alpha_memory.hh 33912757Sgabeblack@google.com alpha_tru64_process.hh 34012757Sgabeblack@google.com aout_machdep.h 34112757Sgabeblack@google.com arguments.hh 34212757Sgabeblack@google.com byte_swap.hh 3438235Snate@binkert.org ecoff_machdep.h 34412302Sgabeblack@google.com ev5.hh 3458235Snate@binkert.org faults.hh 3468235Snate@binkert.org isa_fullsys_traits.hh 34712757Sgabeblack@google.com isa_traits.hh 3488235Snate@binkert.org osfpal.hh 3498235Snate@binkert.org pseudo_inst.hh 3508235Snate@binkert.org vptr.hh 35112757Sgabeblack@google.com vtophys.hh 35212313Sgabeblack@google.com ''') 35312797Sgabeblack@google.com 35412797Sgabeblack@google.comfor f in targetarch_files: 35512797Sgabeblack@google.com env.Command('targetarch/' + f, 'arch/alpha/' + f, 35612797Sgabeblack@google.com '''echo '#include "arch/alpha/%s"' > $TARGET''' % f) 35712797Sgabeblack@google.com 35812797Sgabeblack@google.com 35912797Sgabeblack@google.com# Set up complete list of sources based on configuration. 36012797Sgabeblack@google.comsources = base_sources 36112797Sgabeblack@google.com 36212797Sgabeblack@google.comif env['FULL_SYSTEM']: 36312797Sgabeblack@google.com sources += full_system_sources 36412797Sgabeblack@google.com if env['ALPHA_TLASER']: 36512797Sgabeblack@google.com sources += turbolaser_sources 36612797Sgabeblack@google.comelse: 36712797Sgabeblack@google.com sources += syscall_emulation_sources 36812797Sgabeblack@google.com 36912797Sgabeblack@google.comif env['USE_MYSQL']: 37012797Sgabeblack@google.com sources += mysql_sources 37112797Sgabeblack@google.com 37212797Sgabeblack@google.comfor opt in env.ExportOptions: 37312797Sgabeblack@google.com env.ConfigFile(opt) 37412797Sgabeblack@google.com 37512797Sgabeblack@google.com################################################### 37612797Sgabeblack@google.com# 37712797Sgabeblack@google.com# Special build rules. 37812797Sgabeblack@google.com# 37912797Sgabeblack@google.com################################################### 38012797Sgabeblack@google.com 38112797Sgabeblack@google.com# base/traceflags.{cc,hh} are generated from base/traceflags.py. 38212797Sgabeblack@google.com# $TARGET.base will expand to "<build-dir>/base/traceflags". 38312797Sgabeblack@google.comenv.Command(Split('base/traceflags.hh base/traceflags.cc'), 38412797Sgabeblack@google.com 'base/traceflags.py', 38512797Sgabeblack@google.com 'python $SOURCE $TARGET.base') 38612797Sgabeblack@google.com 38712797Sgabeblack@google.com# several files are generated from arch/$TARGET_ISA/isa_desc. 38812797Sgabeblack@google.comenv.Command(Split('''arch/alpha/decoder.cc 38912797Sgabeblack@google.com arch/alpha/decoder.hh 39012797Sgabeblack@google.com arch/alpha/alpha_o3_exec.cc 39112797Sgabeblack@google.com arch/alpha/fast_cpu_exec.cc 39212797Sgabeblack@google.com arch/alpha/simple_cpu_exec.cc 39312797Sgabeblack@google.com arch/alpha/full_cpu_exec.cc'''), 39412797Sgabeblack@google.com Split('''arch/alpha/isa_desc 39512797Sgabeblack@google.com arch/isa_parser.py'''), 39612797Sgabeblack@google.com '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha') 39712313Sgabeblack@google.com 39812313Sgabeblack@google.com 39912797Sgabeblack@google.com# libelf build is described in its own SConscript file. 40012797Sgabeblack@google.com# SConscript-local is the per-config build, which just copies some 40112797Sgabeblack@google.com# header files into a place where they can be found. 40212371Sgabeblack@google.comSConscript('libelf/SConscript-local', exports = 'env', duplicate=0) 4035584Snate@binkert.orgSConscript('python/SConscript', exports = ['env'], duplicate=0) 40412797Sgabeblack@google.com 40512797Sgabeblack@google.com# This function adds the specified sources to the given build 40612797Sgabeblack@google.com# environment, and returns a list of all the corresponding SCons 40712797Sgabeblack@google.com# Object nodes (including an extra one for date.cc). We explicitly 40812797Sgabeblack@google.com# add the Object nodes so we can set up special dependencies for 40912797Sgabeblack@google.com# date.cc. 41012797Sgabeblack@google.comdef make_objs(sources, env): 41112797Sgabeblack@google.com objs = [env.Object(s) for s in sources] 41212797Sgabeblack@google.com # make date.cc depend on all other objects so it always gets 41312797Sgabeblack@google.com # recompiled whenever anything else does 41412797Sgabeblack@google.com date_obj = env.Object('base/date.cc') 41512797Sgabeblack@google.com env.Depends(date_obj, objs) 41612797Sgabeblack@google.com objs.append(date_obj) 41712797Sgabeblack@google.com return objs 41812797Sgabeblack@google.com 41912797Sgabeblack@google.com################################################### 42012797Sgabeblack@google.com# 42112797Sgabeblack@google.com# Define binaries. Each different build type (debug, opt, etc.) gets 42212797Sgabeblack@google.com# a slightly different build environment. 42312797Sgabeblack@google.com# 42412797Sgabeblack@google.com################################################### 42512797Sgabeblack@google.com 42612797Sgabeblack@google.com# Include file paths are rooted in this directory. SCons will 42712797Sgabeblack@google.com# automatically expand '.' to refer to both the source directory and 42812797Sgabeblack@google.com# the corresponding build directory to pick up generated include 42912797Sgabeblack@google.com# files. 43012797Sgabeblack@google.comenv.Append(CPPPATH='.') 43112797Sgabeblack@google.com 43212797Sgabeblack@google.com# Debug binary 43312797Sgabeblack@google.comdebug = env.Copy(OBJSUFFIX='.do') 43412797Sgabeblack@google.comdebug.Append(CCFLAGS=Split('-g -gstabs+ -O0')) 43512797Sgabeblack@google.comdebug.Append(CPPDEFINES='DEBUG') 43612797Sgabeblack@google.comdebug.Program(target = 'm5.debug', source = make_objs(sources, debug)) 43712797Sgabeblack@google.com 43812797Sgabeblack@google.com# Optimized binary 43912797Sgabeblack@google.comopt = env.Copy() 44012797Sgabeblack@google.comopt.Append(CCFLAGS=Split('-g -O5')) 44112797Sgabeblack@google.comopt.Program(target = 'm5.opt', source = make_objs(sources, opt)) 4424382Sbinkertn@umich.edu 4434202Sbinkertn@umich.edu# "Fast" binary 4444382Sbinkertn@umich.edufast = env.Copy(OBJSUFFIX='.fo') 4454382Sbinkertn@umich.edufast.Append(CCFLAGS=Split('-O5')) 4469396Sandreas.hansson@arm.comfast.Append(CPPDEFINES='NDEBUG') 44712797Sgabeblack@google.comfast.Program(target = 'm5.fast.unstripped', source = make_objs(sources, fast)) 4485584Snate@binkert.orgfast.Command(target = 'm5.fast', source = 'm5.fast.unstripped', 44912313Sgabeblack@google.com action = 'strip $SOURCE -o $TARGET') 4504382Sbinkertn@umich.edu 4514382Sbinkertn@umich.edu# Profiled binary 4524382Sbinkertn@umich.eduprof = env.Copy(OBJSUFFIX='.po') 4538232Snate@binkert.orgprof.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg') 4545192Ssaidi@eecs.umich.eduprof.Program(target = 'm5.prof', source = make_objs(sources, prof)) 4558232Snate@binkert.org