SConscript revision 1511
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.org 326143Snate@binkert.org# This file defines how to build a particular configuration of M5 334762Snate@binkert.org# based on variable settings in the 'env' build environment. 345522Snate@binkert.org 35955SN/A# Import build environment variable from SConstruct. 365522Snate@binkert.orgImport('env') 3711974Sgabeblack@google.com 38955SN/A################################################### 395522Snate@binkert.org# 404202Sbinkertn@umich.edu# Define needed sources. 415742Snate@binkert.org# 42955SN/A################################################### 434381Sbinkertn@umich.edu 444381Sbinkertn@umich.edu# Base sources used by all configurations. 4512246Sgabeblack@google.combase_sources = Split(''' 4612246Sgabeblack@google.com arch/alpha/decoder.cc 478334Snate@binkert.org arch/alpha/fast_cpu_exec.cc 48955SN/A arch/alpha/simple_cpu_exec.cc 49955SN/A arch/alpha/inorder_cpu_exec.cc 504202Sbinkertn@umich.edu arch/alpha/full_cpu_exec.cc 51955SN/A arch/alpha/faults.cc 524382Sbinkertn@umich.edu arch/alpha/isa_traits.cc 534382Sbinkertn@umich.edu 544382Sbinkertn@umich.edu base/circlebuf.cc 556654Snate@binkert.org base/copyright.cc 565517Snate@binkert.org base/cprintf.cc 578614Sgblack@eecs.umich.edu base/embedfile.cc 587674Snate@binkert.org base/fast_alloc.cc 596143Snate@binkert.org base/fifo_buffer.cc 606143Snate@binkert.org base/hostinfo.cc 616143Snate@binkert.org base/hybrid_pred.cc 6212302Sgabeblack@google.com base/inifile.cc 6312302Sgabeblack@google.com base/intmath.cc 6412302Sgabeblack@google.com base/match.cc 6512302Sgabeblack@google.com base/misc.cc 6612302Sgabeblack@google.com base/output.cc 6712302Sgabeblack@google.com base/pollevent.cc 6812302Sgabeblack@google.com base/python.cc 6912302Sgabeblack@google.com base/range.cc 7012302Sgabeblack@google.com base/random.cc 7112302Sgabeblack@google.com base/sat_counter.cc 7212302Sgabeblack@google.com base/socket.cc 7312302Sgabeblack@google.com base/statistics.cc 7412302Sgabeblack@google.com base/str.cc 7512302Sgabeblack@google.com base/time.cc 7612302Sgabeblack@google.com base/trace.cc 7712302Sgabeblack@google.com base/traceflags.cc 7812302Sgabeblack@google.com base/userinfo.cc 7912302Sgabeblack@google.com base/compression/lzss_compression.cc 8012302Sgabeblack@google.com base/loader/aout_object.cc 8112302Sgabeblack@google.com base/loader/ecoff_object.cc 8212302Sgabeblack@google.com base/loader/elf_object.cc 8312302Sgabeblack@google.com base/loader/object_file.cc 8412302Sgabeblack@google.com base/loader/symtab.cc 8512302Sgabeblack@google.com base/stats/events.cc 8612302Sgabeblack@google.com base/stats/python.cc 8712302Sgabeblack@google.com base/stats/statdb.cc 8812302Sgabeblack@google.com base/stats/visit.cc 8912302Sgabeblack@google.com base/stats/text.cc 9012302Sgabeblack@google.com 9111983Sgabeblack@google.com cpu/base_cpu.cc 926143Snate@binkert.org cpu/exec_context.cc 938233Snate@binkert.org cpu/exetrace.cc 9412302Sgabeblack@google.com cpu/pc_event.cc 956143Snate@binkert.org cpu/static_inst.cc 966143Snate@binkert.org cpu/fast_cpu/fast_cpu.cc 9712302Sgabeblack@google.com cpu/full_cpu/bpred.cc 984762Snate@binkert.org cpu/full_cpu/commit.cc 996143Snate@binkert.org cpu/full_cpu/create_vector.cc 1008233Snate@binkert.org cpu/full_cpu/cv_spec_state.cc 1018233Snate@binkert.org cpu/full_cpu/dd_queue.cc 10212302Sgabeblack@google.com cpu/full_cpu/dep_link.cc 10312302Sgabeblack@google.com cpu/full_cpu/dispatch.cc 1046143Snate@binkert.org cpu/full_cpu/dyn_inst.cc 10512302Sgabeblack@google.com cpu/full_cpu/execute.cc 10612302Sgabeblack@google.com cpu/full_cpu/fetch.cc 10712302Sgabeblack@google.com cpu/full_cpu/floss_reasons.cc 10812302Sgabeblack@google.com cpu/full_cpu/fu_pool.cc 10912302Sgabeblack@google.com cpu/full_cpu/full_cpu.cc 11012302Sgabeblack@google.com cpu/full_cpu/inst_fifo.cc 11112302Sgabeblack@google.com cpu/full_cpu/instpipe.cc 11212302Sgabeblack@google.com cpu/full_cpu/issue.cc 11312302Sgabeblack@google.com cpu/full_cpu/ls_queue.cc 11412302Sgabeblack@google.com cpu/full_cpu/machine_queue.cc 1158233Snate@binkert.org cpu/full_cpu/pc_sample_profile.cc 1166143Snate@binkert.org cpu/full_cpu/pipetrace.cc 1176143Snate@binkert.org cpu/full_cpu/readyq.cc 1186143Snate@binkert.org cpu/full_cpu/reg_info.cc 1196143Snate@binkert.org cpu/full_cpu/rob_station.cc 1206143Snate@binkert.org cpu/full_cpu/spec_memory.cc 1216143Snate@binkert.org cpu/full_cpu/spec_state.cc 1226143Snate@binkert.org cpu/full_cpu/storebuffer.cc 1236143Snate@binkert.org cpu/full_cpu/writeback.cc 1246143Snate@binkert.org cpu/full_cpu/iq/iq_station.cc 1257065Snate@binkert.org cpu/full_cpu/iq/iqueue.cc 1266143Snate@binkert.org cpu/full_cpu/iq/segmented/chain_info.cc 1278233Snate@binkert.org cpu/full_cpu/iq/segmented/chain_wire.cc 1288233Snate@binkert.org cpu/full_cpu/iq/segmented/iq_seg.cc 1298233Snate@binkert.org cpu/full_cpu/iq/segmented/iq_segmented.cc 1308233Snate@binkert.org cpu/full_cpu/iq/segmented/seg_chain.cc 1318233Snate@binkert.org cpu/full_cpu/iq/seznec/iq_seznec.cc 1328233Snate@binkert.org cpu/full_cpu/iq/standard/iq_standard.cc 1338233Snate@binkert.org cpu/sampling_cpu/sampling_cpu.cc 1348233Snate@binkert.org cpu/simple_cpu/simple_cpu.cc 1358233Snate@binkert.org cpu/inorder_cpu/inorder_cpu.cc 1368233Snate@binkert.org cpu/trace/reader/mem_trace_reader.cc 1378233Snate@binkert.org cpu/trace/reader/ibm_reader.cc 1388233Snate@binkert.org cpu/trace/reader/itx_reader.cc 1398233Snate@binkert.org cpu/trace/reader/m5_reader.cc 1408233Snate@binkert.org 1418233Snate@binkert.org mem/base_hier.cc 1428233Snate@binkert.org mem/base_mem.cc 1438233Snate@binkert.org mem/hier_params.cc 1448233Snate@binkert.org mem/mem_cmd.cc 1458233Snate@binkert.org mem/mem_debug.cc 1468233Snate@binkert.org mem/mem_req.cc 1478233Snate@binkert.org mem/memory_interface.cc 1486143Snate@binkert.org mem/bus/base_interface.cc 1496143Snate@binkert.org mem/bus/bus.cc 1506143Snate@binkert.org mem/bus/bus_bridge.cc 1516143Snate@binkert.org mem/bus/bus_bridge_master.cc 1526143Snate@binkert.org mem/bus/bus_bridge_slave.cc 1536143Snate@binkert.org mem/bus/bus_interface.cc 1549982Satgutier@umich.edu mem/bus/dma_bus_interface.cc 1556143Snate@binkert.org mem/bus/dma_interface.cc 15612302Sgabeblack@google.com mem/bus/master_interface.cc 15712302Sgabeblack@google.com mem/bus/slave_interface.cc 15812302Sgabeblack@google.com mem/cache/base_cache.cc 15912302Sgabeblack@google.com mem/cache/cache.cc 16012302Sgabeblack@google.com mem/cache/cache_builder.cc 16112302Sgabeblack@google.com mem/cache/coherence/coherence_protocol.cc 16212302Sgabeblack@google.com mem/cache/coherence/uni_coherence.cc 16312302Sgabeblack@google.com mem/cache/miss/blocking_buffer.cc 16411983Sgabeblack@google.com mem/cache/miss/miss_queue.cc 16511983Sgabeblack@google.com mem/cache/miss/mshr.cc 16611983Sgabeblack@google.com mem/cache/miss/mshr_queue.cc 16712302Sgabeblack@google.com mem/cache/tags/base_tags.cc 16812302Sgabeblack@google.com mem/cache/tags/cache_tags.cc 16912302Sgabeblack@google.com mem/cache/tags/fa_lru.cc 17012302Sgabeblack@google.com mem/cache/tags/iic.cc 17112302Sgabeblack@google.com mem/cache/tags/lru.cc 17212302Sgabeblack@google.com mem/cache/tags/split.cc 17311983Sgabeblack@google.com mem/cache/tags/split_lifo.cc 1746143Snate@binkert.org mem/cache/tags/split_lru.cc 17512305Sgabeblack@google.com mem/cache/tags/repl/gen.cc 17612302Sgabeblack@google.com mem/cache/tags/repl/repl.cc 17712302Sgabeblack@google.com mem/functional_mem/functional_memory.cc 17812302Sgabeblack@google.com mem/functional_mem/main_memory.cc 1796143Snate@binkert.org mem/timing_mem/base_memory.cc 1806143Snate@binkert.org mem/timing_mem/memory_builder.cc 1816143Snate@binkert.org mem/timing_mem/simple_mem_bank.cc 1825522Snate@binkert.org mem/trace/itx_writer.cc 1836143Snate@binkert.org mem/trace/mem_trace_writer.cc 1846143Snate@binkert.org mem/trace/m5_writer.cc 1856143Snate@binkert.org 1869982Satgutier@umich.edu python/pyconfig.cc 18712302Sgabeblack@google.com python/embedded_py.cc 18812302Sgabeblack@google.com 18912302Sgabeblack@google.com sim/builder.cc 1906143Snate@binkert.org sim/configfile.cc 1916143Snate@binkert.org sim/debug.cc 1926143Snate@binkert.org sim/eventq.cc 1936143Snate@binkert.org sim/main.cc 1945522Snate@binkert.org sim/param.cc 1955522Snate@binkert.org sim/profile.cc 1965522Snate@binkert.org sim/serialize.cc 1975522Snate@binkert.org sim/sim_events.cc 1985604Snate@binkert.org sim/sim_exit.cc 1995604Snate@binkert.org sim/sim_object.cc 2006143Snate@binkert.org sim/startup.cc 2016143Snate@binkert.org sim/stat_context.cc 2024762Snate@binkert.org sim/stat_control.cc 2034762Snate@binkert.org sim/trace_context.cc 2046143Snate@binkert.org sim/universe.cc 2056727Ssteve.reinhardt@amd.com ''') 2066727Ssteve.reinhardt@amd.com 2076727Ssteve.reinhardt@amd.com# MySql sources 2084762Snate@binkert.orgmysql_sources = Split(''' 2096143Snate@binkert.org base/mysql.cc 2106143Snate@binkert.org base/stats/mysql.cc 2116143Snate@binkert.org ''') 2126143Snate@binkert.org 2136727Ssteve.reinhardt@amd.com# Full-system sources 2146143Snate@binkert.orgfull_system_sources = Split(''' 2157674Snate@binkert.org arch/alpha/alpha_memory.cc 2167674Snate@binkert.org arch/alpha/arguments.cc 2175604Snate@binkert.org arch/alpha/ev5.cc 2186143Snate@binkert.org arch/alpha/osfpal.cc 2196143Snate@binkert.org arch/alpha/pseudo_inst.cc 2206143Snate@binkert.org arch/alpha/vtophys.cc 2214762Snate@binkert.org 2226143Snate@binkert.org base/crc.cc 2234762Snate@binkert.org base/inet.cc 2244762Snate@binkert.org base/remote_gdb.cc 2254762Snate@binkert.org 2266143Snate@binkert.org cpu/intr_control.cc 2276143Snate@binkert.org 2284762Snate@binkert.org dev/alpha_console.cc 22912302Sgabeblack@google.com dev/baddev.cc 23012302Sgabeblack@google.com dev/simconsole.cc 2318233Snate@binkert.org dev/disk_image.cc 23212302Sgabeblack@google.com dev/dma.cc 2336143Snate@binkert.org dev/etherbus.cc 2346143Snate@binkert.org dev/etherdump.cc 2354762Snate@binkert.org dev/etherint.cc 2366143Snate@binkert.org dev/etherlink.cc 2374762Snate@binkert.org dev/etherpkt.cc 2389396Sandreas.hansson@arm.com dev/ethertap.cc 2399396Sandreas.hansson@arm.com dev/ide_ctrl.cc 2409396Sandreas.hansson@arm.com dev/ide_disk.cc 24112302Sgabeblack@google.com dev/io_device.cc 24212302Sgabeblack@google.com dev/ns_gige.cc 24312302Sgabeblack@google.com dev/etherdev.cc 2449396Sandreas.hansson@arm.com dev/pciconfigall.cc 2459396Sandreas.hansson@arm.com dev/pcidev.cc 2469396Sandreas.hansson@arm.com dev/pktfifo.cc 2479396Sandreas.hansson@arm.com dev/scsi.cc 2489396Sandreas.hansson@arm.com dev/scsi_ctrl.cc 2499396Sandreas.hansson@arm.com dev/scsi_disk.cc 2509396Sandreas.hansson@arm.com dev/scsi_none.cc 2519930Sandreas.hansson@arm.com dev/sinic.cc 2529930Sandreas.hansson@arm.com dev/simple_disk.cc 2539396Sandreas.hansson@arm.com dev/tlaser_clock.cc 2548235Snate@binkert.org dev/tlaser_ipi.cc 2558235Snate@binkert.org dev/tlaser_mbox.cc 2566143Snate@binkert.org dev/tlaser_mc146818.cc 2578235Snate@binkert.org dev/tlaser_node.cc 2589003SAli.Saidi@ARM.com dev/tlaser_pcia.cc 2598235Snate@binkert.org dev/tlaser_pcidev.cc 2608235Snate@binkert.org dev/tlaser_serial.cc 26112302Sgabeblack@google.com dev/turbolaser.cc 2628235Snate@binkert.org dev/tsunami.cc 26312302Sgabeblack@google.com dev/tsunami_cchip.cc 2648235Snate@binkert.org dev/tsunami_fake.cc 2658235Snate@binkert.org dev/tsunami_io.cc 26612302Sgabeblack@google.com dev/tsunami_pchip.cc 2678235Snate@binkert.org dev/uart.cc 2688235Snate@binkert.org 2698235Snate@binkert.org kern/kernel_binning.cc 2708235Snate@binkert.org kern/kernel_stats.cc 2719003SAli.Saidi@ARM.com kern/system_events.cc 2728235Snate@binkert.org kern/linux/linux_events.cc 2735584Snate@binkert.org kern/linux/linux_syscalls.cc 2744382Sbinkertn@umich.edu kern/linux/linux_system.cc 2754202Sbinkertn@umich.edu kern/linux/printk.cc 2764382Sbinkertn@umich.edu kern/tru64/dump_mbuf.cc 2774382Sbinkertn@umich.edu kern/tru64/printf.cc 2789396Sandreas.hansson@arm.com kern/tru64/tru64_events.cc 2795584Snate@binkert.org kern/tru64/tru64_syscalls.cc 2804382Sbinkertn@umich.edu kern/tru64/tru64_system.cc 2814382Sbinkertn@umich.edu 2824382Sbinkertn@umich.edu mem/functional_mem/memory_control.cc 2838232Snate@binkert.org mem/functional_mem/physical_memory.cc 2845192Ssaidi@eecs.umich.edu dev/platform.cc 2858232Snate@binkert.org 2868232Snate@binkert.org sim/system.cc 2878232Snate@binkert.org ''') 2885192Ssaidi@eecs.umich.edu 2898232Snate@binkert.org# Syscall emulation (non-full-system) sources 2905192Ssaidi@eecs.umich.edusyscall_emulation_sources = Split(''' 2915799Snate@binkert.org arch/alpha/alpha_common_syscall_emul.cc 2928232Snate@binkert.org arch/alpha/alpha_linux_process.cc 2935192Ssaidi@eecs.umich.edu arch/alpha/alpha_tru64_process.cc 2945192Ssaidi@eecs.umich.edu cpu/memtest/memtest.cc 2955192Ssaidi@eecs.umich.edu cpu/trace/opt_cpu.cc 2968232Snate@binkert.org cpu/trace/trace_cpu.cc 2975192Ssaidi@eecs.umich.edu eio/eio.cc 2988232Snate@binkert.org eio/exolex.cc 2995192Ssaidi@eecs.umich.edu eio/libexo.cc 3005192Ssaidi@eecs.umich.edu sim/process.cc 3015192Ssaidi@eecs.umich.edu sim/syscall_emul.cc 3025192Ssaidi@eecs.umich.edu ''') 3034382Sbinkertn@umich.edu 3044382Sbinkertn@umich.edutargetarch_files = Split(''' 3054382Sbinkertn@umich.edu alpha_common_syscall_emul.hh 3062667Sstever@eecs.umich.edu alpha_linux_process.hh 3072667Sstever@eecs.umich.edu alpha_memory.hh 3082667Sstever@eecs.umich.edu alpha_tru64_process.hh 3092667Sstever@eecs.umich.edu aout_machdep.h 3102667Sstever@eecs.umich.edu arguments.hh 3112667Sstever@eecs.umich.edu byte_swap.hh 3125742Snate@binkert.org ecoff_machdep.h 3135742Snate@binkert.org elf_machdep.h 3145742Snate@binkert.org ev5.hh 3155793Snate@binkert.org faults.hh 3168334Snate@binkert.org isa_fullsys_traits.hh 3175793Snate@binkert.org isa_traits.hh 3185793Snate@binkert.org machine_exo.h 3195793Snate@binkert.org osfpal.hh 3204382Sbinkertn@umich.edu pseudo_inst.hh 3214762Snate@binkert.org vptr.hh 3225344Sstever@gmail.com vtophys.hh 3234382Sbinkertn@umich.edu ''') 3245341Sstever@gmail.com 3255742Snate@binkert.orgfor f in targetarch_files: 3265742Snate@binkert.org env.Command('targetarch/' + f, 'arch/alpha/' + f, 3275742Snate@binkert.org '''echo '#include "arch/alpha/%s"' > $TARGET''' % f) 3285742Snate@binkert.org 3295742Snate@binkert.org 3304762Snate@binkert.org# Set up complete list of sources based on configuration. 3315742Snate@binkert.orgsources = base_sources 3325742Snate@binkert.org 33311984Sgabeblack@google.comif env['FULL_SYSTEM']: 3347722Sgblack@eecs.umich.edu sources += full_system_sources 3355742Snate@binkert.orgelse: 3365742Snate@binkert.org sources += syscall_emulation_sources 3375742Snate@binkert.org 3389930Sandreas.hansson@arm.comextra_libraries = [] 3399930Sandreas.hansson@arm.comenv.Append(LIBS=['z']) 3409930Sandreas.hansson@arm.comif env['USE_MYSQL']: 3419930Sandreas.hansson@arm.com sources += mysql_sources 3429930Sandreas.hansson@arm.com env.Append(CPPDEFINES = 'USE_MYSQL') 3435742Snate@binkert.org env.Append(CPPDEFINES = 'STATS_BINNING') 3448242Sbradley.danofsky@amd.com env.Append(CPPPATH=['/usr/local/include/mysql', '/usr/include/mysql']) 3458242Sbradley.danofsky@amd.com if os.path.isdir('/usr/lib64'): 3468242Sbradley.danofsky@amd.com env.Append(LIBPATH=['/usr/lib64/mysql']) 3478242Sbradley.danofsky@amd.com else: 3485341Sstever@gmail.com env.Append(LIBPATH=['/usr/lib/mysql/']) 3495742Snate@binkert.org env.Append(LIBS=['mysqlclient']) 3507722Sgblack@eecs.umich.edu 3514773Snate@binkert.org 3526108Snate@binkert.org################################################### 3531858SN/A# 3541085SN/A# Special build rules. 3556658Snate@binkert.org# 3566658Snate@binkert.org################################################### 3577673Snate@binkert.org 3586658Snate@binkert.org# base/traceflags.{cc,hh} are generated from base/traceflags.py. 3596658Snate@binkert.org# $TARGET.base will expand to "<build-dir>/base/traceflags". 36011308Santhony.gutierrez@amd.comenv.Command(Split('base/traceflags.hh base/traceflags.cc'), 3616658Snate@binkert.org 'base/traceflags.py', 36211308Santhony.gutierrez@amd.com 'python $SOURCE $TARGET.base') 3636658Snate@binkert.org 3646658Snate@binkert.org# several files are generated from arch/$TARGET_ISA/isa_desc. 3657673Snate@binkert.orgenv.Command(Split('''arch/alpha/decoder.cc 3667673Snate@binkert.org arch/alpha/decoder.hh 3677673Snate@binkert.org arch/alpha/fast_cpu_exec.cc 3687673Snate@binkert.org arch/alpha/simple_cpu_exec.cc 3697673Snate@binkert.org arch/alpha/inorder_cpu_exec.cc 3707673Snate@binkert.org arch/alpha/full_cpu_exec.cc'''), 3717673Snate@binkert.org Split('''arch/alpha/isa_desc 37210467Sandreas.hansson@arm.com arch/isa_parser.py'''), 3736658Snate@binkert.org '$SRCDIR/arch/isa_parser.py $SOURCE $TARGET.dir arch/alpha') 3747673Snate@binkert.org 37510467Sandreas.hansson@arm.com 37610467Sandreas.hansson@arm.com# libelf build is described in its own SConscript file. 37710467Sandreas.hansson@arm.com# SConscript-local is the per-config build, which just copies some 37810467Sandreas.hansson@arm.com# header files into a place where they can be found. 37910467Sandreas.hansson@arm.comSConscript('libelf/SConscript-local', exports = 'env', duplicate=0) 38010467Sandreas.hansson@arm.comSConscript('python/SConscript', exports = ['env'], duplicate=0) 38110467Sandreas.hansson@arm.com 38210467Sandreas.hansson@arm.com 38310467Sandreas.hansson@arm.com# This function adds the specified sources to the given build 38410467Sandreas.hansson@arm.com# environment, and returns a list of all the corresponding SCons 38510467Sandreas.hansson@arm.com# Object nodes (including an extra one for date.cc). We explicitly 3867673Snate@binkert.org# add the Object nodes so we can set up special dependencies for 3877673Snate@binkert.org# date.cc. 3887673Snate@binkert.orgdef make_objs(sources, env): 3897673Snate@binkert.org objs = [env.Object(s) for s in sources] 3907673Snate@binkert.org # make date.cc depend on all other objects so it always gets 3919048SAli.Saidi@ARM.com # recompiled whenever anything else does 3927673Snate@binkert.org date_obj = env.Object('base/date.cc') 3937673Snate@binkert.org env.Depends(date_obj, objs) 3947673Snate@binkert.org objs.append(date_obj) 3957673Snate@binkert.org objs.extend(extra_libraries) 3966658Snate@binkert.org return objs 3977756SAli.Saidi@ARM.com 3987816Ssteve.reinhardt@amd.com################################################### 3996658Snate@binkert.org# 40011308Santhony.gutierrez@amd.com# Define binaries. Each different build type (debug, opt, etc.) gets 40111308Santhony.gutierrez@amd.com# a slightly different build environment. 40211308Santhony.gutierrez@amd.com# 40311308Santhony.gutierrez@amd.com################################################### 40411308Santhony.gutierrez@amd.com 40511308Santhony.gutierrez@amd.com# Include file paths are rooted in this directory. SCons will 40611308Santhony.gutierrez@amd.com# automatically expand '.' to refer to both the source directory and 40711308Santhony.gutierrez@amd.com# the corresponding build directory to pick up generated include 40811308Santhony.gutierrez@amd.com# files. 40911308Santhony.gutierrez@amd.comenv.Append(CPPPATH='.') 41011308Santhony.gutierrez@amd.com 41111308Santhony.gutierrez@amd.com# Debug binary 41211308Santhony.gutierrez@amd.comdebug = env.Copy(OBJSUFFIX='.do') 41311308Santhony.gutierrez@amd.comdebug.Append(CCFLAGS=Split('-g -gstabs+ -O0')) 41411308Santhony.gutierrez@amd.comdebug.Append(CPPDEFINES='DEBUG') 41511308Santhony.gutierrez@amd.comdebug.Program(target = 'm5.debug', source = make_objs(sources, debug)) 41611308Santhony.gutierrez@amd.com 41711308Santhony.gutierrez@amd.com# Optimized binary 41811308Santhony.gutierrez@amd.comopt = env.Copy() 41911308Santhony.gutierrez@amd.comopt.Append(CCFLAGS=Split('-g -O5')) 42011308Santhony.gutierrez@amd.comopt.Program(target = 'm5.opt', source = make_objs(sources, opt)) 42111308Santhony.gutierrez@amd.com 42211308Santhony.gutierrez@amd.com# "Fast" binary 42311308Santhony.gutierrez@amd.comfast = env.Copy(OBJSUFFIX='.fo') 42411308Santhony.gutierrez@amd.comfast.Append(CCFLAGS=Split('-O5')) 42511308Santhony.gutierrez@amd.comfast.Append(CPPDEFINES='NDEBUG') 42611308Santhony.gutierrez@amd.comfast.Program(target = 'm5.fast.unstripped', source = make_objs(sources, fast)) 42711308Santhony.gutierrez@amd.comfast.Command(target = 'm5.fast', source = 'm5.fast.unstripped', 42811308Santhony.gutierrez@amd.com action = 'strip $SOURCE -o $TARGET') 42911308Santhony.gutierrez@amd.com 43011308Santhony.gutierrez@amd.com# Profiled binary 43111308Santhony.gutierrez@amd.comprof = env.Copy(OBJSUFFIX='.po') 43211308Santhony.gutierrez@amd.comprof.Append(CCFLAGS=Split('-O5 -g -pg'), LINKFLAGS='-pg') 43311308Santhony.gutierrez@amd.comprof.Program(target = 'm5.prof', source = make_objs(sources, prof)) 43411308Santhony.gutierrez@amd.com