2004-07-03 06:16:38 +02:00
|
|
|
# -*- mode:python -*-
|
|
|
|
|
2005-06-05 11:16:00 +02:00
|
|
|
# Copyright (c) 2004-2005 The Regents of The University of Michigan
|
2004-07-03 06:16:38 +02:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions are
|
|
|
|
# met: redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer;
|
|
|
|
# redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution;
|
|
|
|
# neither the name of the copyright holders nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products derived from
|
|
|
|
# this software without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
2005-03-28 07:41:28 +02:00
|
|
|
from os.path import isdir
|
2004-07-03 06:16:38 +02:00
|
|
|
|
|
|
|
# This file defines how to build a particular configuration of M5
|
|
|
|
# based on variable settings in the 'env' build environment.
|
|
|
|
|
|
|
|
# Import build environment variable from SConstruct.
|
|
|
|
Import('env')
|
|
|
|
|
|
|
|
###################################################
|
|
|
|
#
|
|
|
|
# Define needed sources.
|
|
|
|
#
|
|
|
|
###################################################
|
|
|
|
|
|
|
|
# Base sources used by all configurations.
|
|
|
|
|
2006-01-25 01:57:17 +01:00
|
|
|
base_sources = Split('''
|
2004-07-03 06:16:38 +02:00
|
|
|
base/circlebuf.cc
|
|
|
|
base/copyright.cc
|
|
|
|
base/cprintf.cc
|
2005-01-15 10:12:25 +01:00
|
|
|
base/embedfile.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
base/fast_alloc.cc
|
|
|
|
base/fifo_buffer.cc
|
|
|
|
base/hostinfo.cc
|
|
|
|
base/hybrid_pred.cc
|
|
|
|
base/inifile.cc
|
|
|
|
base/intmath.cc
|
2004-07-30 16:47:53 +02:00
|
|
|
base/match.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
base/misc.cc
|
2005-02-11 15:47:41 +01:00
|
|
|
base/output.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
base/pollevent.cc
|
|
|
|
base/range.cc
|
2004-12-13 18:55:13 +01:00
|
|
|
base/random.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
base/sat_counter.cc
|
|
|
|
base/socket.cc
|
|
|
|
base/statistics.cc
|
|
|
|
base/str.cc
|
|
|
|
base/time.cc
|
|
|
|
base/trace.cc
|
|
|
|
base/traceflags.cc
|
|
|
|
base/userinfo.cc
|
|
|
|
base/compression/lzss_compression.cc
|
|
|
|
base/loader/aout_object.cc
|
|
|
|
base/loader/ecoff_object.cc
|
|
|
|
base/loader/elf_object.cc
|
|
|
|
base/loader/object_file.cc
|
|
|
|
base/loader/symtab.cc
|
|
|
|
base/stats/events.cc
|
|
|
|
base/stats/statdb.cc
|
|
|
|
base/stats/visit.cc
|
|
|
|
base/stats/text.cc
|
|
|
|
|
2005-06-05 02:50:10 +02:00
|
|
|
cpu/base.cc
|
2006-03-04 21:18:40 +01:00
|
|
|
cpu/cpu_exec_context.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
cpu/exetrace.cc
|
2006-02-22 04:12:27 +01:00
|
|
|
cpu/op_class.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
cpu/pc_event.cc
|
|
|
|
cpu/static_inst.cc
|
2005-06-05 02:50:10 +02:00
|
|
|
cpu/sampler/sampler.cc
|
|
|
|
|
2006-04-07 21:54:48 +02:00
|
|
|
mem/request.cc
|
2006-03-27 04:44:22 +02:00
|
|
|
mem/connector.cc
|
2006-03-12 23:21:59 +01:00
|
|
|
mem/mem_object.cc
|
2006-02-15 20:53:02 +01:00
|
|
|
mem/physical.cc
|
2006-02-21 17:27:53 +01:00
|
|
|
mem/port.cc
|
2006-03-27 04:44:22 +02:00
|
|
|
mem/bus.cc
|
2006-02-15 20:53:02 +01:00
|
|
|
|
2005-03-12 00:28:38 +01:00
|
|
|
python/pyconfig.cc
|
|
|
|
python/embedded_py.cc
|
|
|
|
|
2004-07-03 06:16:38 +02:00
|
|
|
sim/builder.cc
|
|
|
|
sim/configfile.cc
|
|
|
|
sim/debug.cc
|
|
|
|
sim/eventq.cc
|
Changed the fault enum into a class, and fixed everything up to work with it. Next, the faults need to be pulled out of all the other code so that they are only used to communicate between the CPU and the ISA.
SConscript:
The new faults.cc file in sim allocates the system wide faults. When these faults are generated through a function interface in the ISA, this file may go away.
arch/alpha/alpha_memory.cc:
Changed Fault to Fault * and took the underscores out of fault names.
arch/alpha/alpha_memory.hh:
Changed Fault to Fault *. Also, added an include for the alpha faults.
arch/alpha/ev5.cc:
Changed the fault_addr array into a fault_addr function. Once all of the faults can be expected to have the same type, fault_addr can go away completely and the info it provided will come from the fault itself. Also, Fault was changed to Fault *, and underscores were taken out of fault names.
arch/alpha/isa/decoder.isa:
Changed Fault to Fault * and took the underscores out fault names.
arch/alpha/isa/fp.isa:
Changed Fault to Fault *, and took the underscores out of fault names.
arch/alpha/isa/main.isa:
Changed Fault to Fault *, removed underscores from fault names, and made an include of the alpha faults show up in all the generated files.
arch/alpha/isa/mem.isa:
Changed Fault to Fault * and removed underscores from fault names.
arch/alpha/isa/unimp.isa:
arch/alpha/isa/unknown.isa:
cpu/exec_context.hh:
cpu/ozone/cpu.hh:
cpu/simple/cpu.cc:
dev/alpha_console.cc:
dev/ide_ctrl.cc:
dev/isa_fake.cc:
dev/pciconfigall.cc:
dev/pcidev.cc:
dev/pcidev.hh:
dev/tsunami_cchip.cc:
dev/tsunami_io.cc:
dev/tsunami_pchip.cc:
Changed Fault to Fault *, and removed underscores from fault names.
arch/alpha/isa_traits.hh:
Changed the include of arch/alpha/faults.hh to sim/faults.hh, since the alpha faults weren't needed.
cpu/base_dyn_inst.cc:
Changed Fault to Fault *, and removed underscores from fault names. This file probably shouldn't use the Unimplemented Opcode fault.
cpu/base_dyn_inst.hh:
Changed Fault to Fault * and took the underscores out of the fault names.
cpu/exec_context.cc:
cpu/o3/alpha_dyn_inst.hh:
cpu/o3/alpha_dyn_inst_impl.hh:
cpu/o3/fetch.hh:
dev/alpha_console.hh:
dev/baddev.hh:
dev/ide_ctrl.hh:
dev/isa_fake.hh:
dev/ns_gige.hh:
dev/pciconfigall.hh:
dev/sinic.hh:
dev/tsunami_cchip.hh:
dev/tsunami_io.hh:
dev/tsunami_pchip.hh:
dev/uart.hh:
dev/uart8250.hh:
Changed Fault to Fault *.
cpu/o3/alpha_cpu.hh:
Changed Fault to Fault *, removed underscores from fault names.
cpu/o3/alpha_cpu_impl.hh:
Changed Fault to Fault *, removed underscores from fault names, and changed the fault_addr array to the fault_addr function. Once all faults are from the ISA, this function will probably go away.
cpu/o3/commit_impl.hh:
cpu/o3/fetch_impl.hh:
dev/baddev.cc:
Changed Fault to Fault *, and removed underscores from the fault names.
cpu/o3/regfile.hh:
Added an include for the alpha specific faults which will hopefully go away once the ipr stuff is moved, changed Fault to Fault *, and removed the underscores from fault names.
cpu/simple/cpu.hh:
Changed Fault to Fault *
dev/ns_gige.cc:
Changed Fault to Fault *, and removdd underscores from fault names.
dev/sinic.cc:
Changed Fault to Fault *, and removed the underscores from fault names.
dev/uart8250.cc:
Chanted Fault to Fault *, and removed underscores from fault names.
kern/kernel_stats.cc:
Removed underscores from fault names, and from NumFaults.
kern/kernel_stats.hh:
Changed the predeclaration of Fault from an enum to a class, and changd the "fault" function to work with the classes instead of the enum. Once there are no system wide faults anymore, this code will simplify back to something like it was originally.
sim/faults.cc:
This allocates the system wide faults.
sim/faults.hh:
This declares the system wide faults.
sim/syscall_emul.cc:
sim/syscall_emul.hh:
Removed the underscores from fault names.
--HG--
rename : arch/alpha/faults.cc => sim/faults.cc
rename : arch/alpha/faults.hh => sim/faults.hh
extra : convert_revision : 253d39258237333ae8ec4d8047367cb3ea68569d
2006-02-16 07:22:51 +01:00
|
|
|
sim/faults.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
sim/main.cc
|
|
|
|
sim/param.cc
|
|
|
|
sim/profile.cc
|
2005-06-02 03:59:27 +02:00
|
|
|
sim/root.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
sim/serialize.cc
|
|
|
|
sim/sim_events.cc
|
|
|
|
sim/sim_exit.cc
|
|
|
|
sim/sim_object.cc
|
2004-11-03 17:47:55 +01:00
|
|
|
sim/startup.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
sim/stat_context.cc
|
|
|
|
sim/stat_control.cc
|
2006-01-29 23:28:04 +01:00
|
|
|
sim/system.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
sim/trace_context.cc
|
|
|
|
''')
|
|
|
|
|
2006-02-23 23:00:29 +01:00
|
|
|
# Old FullCPU sources
|
2006-01-29 23:35:53 +01:00
|
|
|
full_cpu_sources = Split('''
|
|
|
|
encumbered/cpu/full/bpred.cc
|
|
|
|
encumbered/cpu/full/commit.cc
|
|
|
|
encumbered/cpu/full/cpu.cc
|
|
|
|
encumbered/cpu/full/create_vector.cc
|
|
|
|
encumbered/cpu/full/cv_spec_state.cc
|
|
|
|
encumbered/cpu/full/dd_queue.cc
|
|
|
|
encumbered/cpu/full/dep_link.cc
|
|
|
|
encumbered/cpu/full/dispatch.cc
|
|
|
|
encumbered/cpu/full/dyn_inst.cc
|
|
|
|
encumbered/cpu/full/execute.cc
|
|
|
|
encumbered/cpu/full/fetch.cc
|
|
|
|
encumbered/cpu/full/floss_reasons.cc
|
2006-02-23 23:00:29 +01:00
|
|
|
encumbered/cpu/full/fu_pool.cc
|
2006-01-29 23:35:53 +01:00
|
|
|
encumbered/cpu/full/inst_fifo.cc
|
|
|
|
encumbered/cpu/full/instpipe.cc
|
|
|
|
encumbered/cpu/full/issue.cc
|
|
|
|
encumbered/cpu/full/ls_queue.cc
|
|
|
|
encumbered/cpu/full/machine_queue.cc
|
|
|
|
encumbered/cpu/full/pipetrace.cc
|
|
|
|
encumbered/cpu/full/readyq.cc
|
|
|
|
encumbered/cpu/full/reg_info.cc
|
|
|
|
encumbered/cpu/full/rob_station.cc
|
|
|
|
encumbered/cpu/full/spec_memory.cc
|
|
|
|
encumbered/cpu/full/spec_state.cc
|
|
|
|
encumbered/cpu/full/storebuffer.cc
|
|
|
|
encumbered/cpu/full/writeback.cc
|
|
|
|
encumbered/cpu/full/iq/iq_station.cc
|
|
|
|
encumbered/cpu/full/iq/iqueue.cc
|
|
|
|
encumbered/cpu/full/iq/segmented/chain_info.cc
|
|
|
|
encumbered/cpu/full/iq/segmented/chain_wire.cc
|
|
|
|
encumbered/cpu/full/iq/segmented/iq_seg.cc
|
|
|
|
encumbered/cpu/full/iq/segmented/iq_segmented.cc
|
|
|
|
encumbered/cpu/full/iq/segmented/seg_chain.cc
|
|
|
|
encumbered/cpu/full/iq/seznec/iq_seznec.cc
|
|
|
|
encumbered/cpu/full/iq/standard/iq_standard.cc
|
|
|
|
''')
|
|
|
|
|
2006-03-10 00:35:28 +01:00
|
|
|
trace_reader_sources = Split('''
|
|
|
|
cpu/trace/reader/mem_trace_reader.cc
|
|
|
|
cpu/trace/reader/ibm_reader.cc
|
|
|
|
cpu/trace/reader/itx_reader.cc
|
|
|
|
cpu/trace/reader/m5_reader.cc
|
|
|
|
cpu/trace/opt_cpu.cc
|
|
|
|
cpu/trace/trace_cpu.cc
|
2006-02-15 23:52:49 +01:00
|
|
|
''')
|
|
|
|
|
2006-03-10 00:35:28 +01:00
|
|
|
|
|
|
|
|
2004-07-03 06:16:38 +02:00
|
|
|
# MySql sources
|
|
|
|
mysql_sources = Split('''
|
|
|
|
base/mysql.cc
|
|
|
|
base/stats/mysql.cc
|
|
|
|
''')
|
|
|
|
|
|
|
|
# Full-system sources
|
|
|
|
full_system_sources = Split('''
|
2004-09-20 16:43:53 +02:00
|
|
|
base/crc.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
base/inet.cc
|
|
|
|
base/remote_gdb.cc
|
|
|
|
|
|
|
|
cpu/intr_control.cc
|
2005-10-19 01:07:42 +02:00
|
|
|
cpu/profile.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
|
|
|
|
dev/alpha_console.cc
|
2006-04-10 20:14:06 +02:00
|
|
|
dev/baddev.cc
|
2006-04-06 20:57:51 +02:00
|
|
|
dev/disk_image.cc
|
2006-04-25 01:31:50 +02:00
|
|
|
dev/etherbus.cc
|
|
|
|
dev/etherdump.cc
|
|
|
|
dev/etherint.cc
|
|
|
|
dev/etherlink.cc
|
|
|
|
dev/etherpkt.cc
|
|
|
|
dev/ethertap.cc
|
|
|
|
dev/ide_ctrl.cc
|
2006-04-20 23:14:30 +02:00
|
|
|
dev/ide_disk.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
dev/io_device.cc
|
2006-04-10 20:14:06 +02:00
|
|
|
dev/isa_fake.cc
|
2006-04-25 01:31:50 +02:00
|
|
|
dev/ns_gige.cc
|
2006-04-11 19:42:47 +02:00
|
|
|
dev/pciconfigall.cc
|
2006-04-20 23:14:30 +02:00
|
|
|
dev/pcidev.cc
|
2006-04-25 01:31:50 +02:00
|
|
|
dev/pcifake.cc
|
|
|
|
dev/pktfifo.cc
|
2006-04-06 20:57:51 +02:00
|
|
|
dev/platform.cc
|
|
|
|
dev/simconsole.cc
|
|
|
|
dev/simple_disk.cc
|
2006-04-25 01:31:50 +02:00
|
|
|
dev/sinic.cc
|
2006-04-10 20:14:06 +02:00
|
|
|
dev/tsunami.cc
|
|
|
|
dev/tsunami_cchip.cc
|
|
|
|
dev/tsunami_io.cc
|
|
|
|
dev/tsunami_fake.cc
|
|
|
|
dev/tsunami_pchip.cc
|
|
|
|
|
2006-04-06 20:57:51 +02:00
|
|
|
dev/uart.cc
|
|
|
|
dev/uart8250.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
|
2004-08-20 17:35:31 +02:00
|
|
|
kern/kernel_binning.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
kern/kernel_stats.cc
|
|
|
|
kern/system_events.cc
|
2006-03-05 02:45:01 +01:00
|
|
|
kern/linux/events.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
kern/linux/linux_syscalls.cc
|
2004-07-31 03:14:05 +02:00
|
|
|
kern/linux/printk.cc
|
2006-03-29 05:44:24 +02:00
|
|
|
|
2006-04-06 06:51:46 +02:00
|
|
|
mem/vport.cc
|
|
|
|
|
2006-03-29 05:44:24 +02:00
|
|
|
sim/pseudo_inst.cc
|
|
|
|
''')
|
|
|
|
|
2006-04-06 06:51:46 +02:00
|
|
|
|
2006-03-29 05:44:24 +02:00
|
|
|
if env['TARGET_ISA'] == 'alpha':
|
|
|
|
full_system_sources += Split('''
|
2004-07-03 06:16:38 +02:00
|
|
|
kern/tru64/dump_mbuf.cc
|
|
|
|
kern/tru64/printf.cc
|
|
|
|
kern/tru64/tru64_events.cc
|
|
|
|
kern/tru64/tru64_syscalls.cc
|
|
|
|
''')
|
|
|
|
|
2005-06-05 07:24:17 +02:00
|
|
|
# turbolaser encumbered sources
|
|
|
|
turbolaser_sources = Split('''
|
|
|
|
encumbered/dev/dma.cc
|
|
|
|
encumbered/dev/etherdev.cc
|
|
|
|
encumbered/dev/scsi.cc
|
|
|
|
encumbered/dev/scsi_ctrl.cc
|
|
|
|
encumbered/dev/scsi_disk.cc
|
|
|
|
encumbered/dev/scsi_none.cc
|
|
|
|
encumbered/dev/tlaser_clock.cc
|
|
|
|
encumbered/dev/tlaser_ipi.cc
|
|
|
|
encumbered/dev/tlaser_mbox.cc
|
|
|
|
encumbered/dev/tlaser_mc146818.cc
|
|
|
|
encumbered/dev/tlaser_node.cc
|
|
|
|
encumbered/dev/tlaser_pcia.cc
|
|
|
|
encumbered/dev/tlaser_pcidev.cc
|
|
|
|
encumbered/dev/tlaser_serial.cc
|
|
|
|
encumbered/dev/turbolaser.cc
|
|
|
|
encumbered/dev/uart8530.cc
|
|
|
|
''')
|
|
|
|
|
2004-07-03 06:16:38 +02:00
|
|
|
# Syscall emulation (non-full-system) sources
|
|
|
|
syscall_emulation_sources = Split('''
|
2006-03-31 01:06:00 +02:00
|
|
|
mem/translating_port.cc
|
2006-03-30 01:42:53 +02:00
|
|
|
mem/page_table.cc
|
2004-07-03 06:16:38 +02:00
|
|
|
sim/process.cc
|
|
|
|
sim/syscall_emul.cc
|
|
|
|
''')
|
|
|
|
|
2006-04-13 11:42:18 +02:00
|
|
|
#if env['TARGET_ISA'] == 'alpha':
|
|
|
|
# syscall_emulation_sources += Split('''
|
|
|
|
# kern/tru64/tru64.cc
|
|
|
|
# ''')
|
2006-03-29 05:44:24 +02:00
|
|
|
|
2006-03-15 00:28:51 +01:00
|
|
|
alpha_eio_sources = Split('''
|
|
|
|
encumbered/eio/exolex.cc
|
|
|
|
encumbered/eio/libexo.cc
|
|
|
|
encumbered/eio/eio.cc
|
|
|
|
''')
|
|
|
|
|
|
|
|
if env['TARGET_ISA'] == 'ALPHA_ISA':
|
|
|
|
syscall_emulation_sources += alpha_eio_sources
|
|
|
|
|
2006-02-21 05:26:39 +01:00
|
|
|
memtest_sources = Split('''
|
|
|
|
cpu/memtest/memtest.cc
|
|
|
|
''')
|
|
|
|
|
2006-02-08 07:03:55 +01:00
|
|
|
# Add a flag defining what THE_ISA should be for all compilation
|
|
|
|
env.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())])
|
2004-10-23 04:49:12 +02:00
|
|
|
|
2006-02-23 20:31:15 +01:00
|
|
|
arch_sources = SConscript('arch/SConscript',
|
|
|
|
exports = 'env', duplicate = False)
|
2004-10-23 04:49:12 +02:00
|
|
|
|
2006-02-23 23:00:29 +01:00
|
|
|
cpu_sources = SConscript('cpu/SConscript',
|
|
|
|
exports = 'env', duplicate = False)
|
|
|
|
|
|
|
|
# This is outside of cpu/SConscript since the source directory isn't
|
|
|
|
# underneath 'cpu'.
|
|
|
|
if 'FullCPU' in env['CPU_MODELS']:
|
|
|
|
cpu_sources += full_cpu_sources
|
2004-10-23 04:49:12 +02:00
|
|
|
|
2004-07-03 06:16:38 +02:00
|
|
|
# Set up complete list of sources based on configuration.
|
2006-02-23 23:00:29 +01:00
|
|
|
sources = base_sources + arch_sources + cpu_sources
|
2004-07-03 06:16:38 +02:00
|
|
|
|
|
|
|
if env['FULL_SYSTEM']:
|
|
|
|
sources += full_system_sources
|
2005-06-05 07:24:17 +02:00
|
|
|
if env['ALPHA_TLASER']:
|
|
|
|
sources += turbolaser_sources
|
2004-07-03 06:16:38 +02:00
|
|
|
else:
|
|
|
|
sources += syscall_emulation_sources
|
|
|
|
|
2005-08-30 19:18:54 +02:00
|
|
|
if env['USE_MYSQL']:
|
2004-07-03 06:16:38 +02:00
|
|
|
sources += mysql_sources
|
2005-08-30 19:18:54 +02:00
|
|
|
|
|
|
|
for opt in env.ExportOptions:
|
|
|
|
env.ConfigFile(opt)
|
2004-09-16 21:11:38 +02:00
|
|
|
|
2004-07-03 06:16:38 +02:00
|
|
|
###################################################
|
|
|
|
#
|
|
|
|
# Special build rules.
|
|
|
|
#
|
|
|
|
###################################################
|
|
|
|
|
|
|
|
# base/traceflags.{cc,hh} are generated from base/traceflags.py.
|
|
|
|
# $TARGET.base will expand to "<build-dir>/base/traceflags".
|
|
|
|
env.Command(Split('base/traceflags.hh base/traceflags.cc'),
|
|
|
|
'base/traceflags.py',
|
|
|
|
'python $SOURCE $TARGET.base')
|
|
|
|
|
2004-08-04 07:46:03 +02:00
|
|
|
# libelf build is described in its own SConscript file.
|
2004-08-07 23:23:01 +02:00
|
|
|
# SConscript-local is the per-config build, which just copies some
|
|
|
|
# header files into a place where they can be found.
|
|
|
|
SConscript('libelf/SConscript-local', exports = 'env', duplicate=0)
|
2005-03-12 00:28:38 +01:00
|
|
|
SConscript('python/SConscript', exports = ['env'], duplicate=0)
|
2004-08-04 07:46:03 +02:00
|
|
|
|
2004-07-03 06:16:38 +02:00
|
|
|
# This function adds the specified sources to the given build
|
|
|
|
# environment, and returns a list of all the corresponding SCons
|
|
|
|
# Object nodes (including an extra one for date.cc). We explicitly
|
|
|
|
# add the Object nodes so we can set up special dependencies for
|
2004-10-23 04:49:12 +02:00
|
|
|
# date.cc.
|
2004-07-03 06:16:38 +02:00
|
|
|
def make_objs(sources, env):
|
|
|
|
objs = [env.Object(s) for s in sources]
|
|
|
|
# make date.cc depend on all other objects so it always gets
|
|
|
|
# recompiled whenever anything else does
|
|
|
|
date_obj = env.Object('base/date.cc')
|
|
|
|
env.Depends(date_obj, objs)
|
|
|
|
objs.append(date_obj)
|
|
|
|
return objs
|
|
|
|
|
|
|
|
###################################################
|
|
|
|
#
|
|
|
|
# Define binaries. Each different build type (debug, opt, etc.) gets
|
|
|
|
# a slightly different build environment.
|
|
|
|
#
|
|
|
|
###################################################
|
|
|
|
|
|
|
|
# Include file paths are rooted in this directory. SCons will
|
|
|
|
# automatically expand '.' to refer to both the source directory and
|
|
|
|
# the corresponding build directory to pick up generated include
|
|
|
|
# files.
|
|
|
|
env.Append(CPPPATH='.')
|
2006-03-04 09:09:23 +01:00
|
|
|
env.Append(CPPPATH='./libelf')
|
2004-07-03 06:16:38 +02:00
|
|
|
|
|
|
|
# Debug binary
|
2005-09-05 22:31:27 +02:00
|
|
|
debugEnv = env.Copy(OBJSUFFIX='.do')
|
|
|
|
debugEnv.Label = 'debug'
|
2006-04-18 19:49:23 +02:00
|
|
|
debugEnv.Append(CCFLAGS=Split('-g3 -gdwarf-2 -O0'))
|
2005-09-05 22:31:27 +02:00
|
|
|
debugEnv.Append(CPPDEFINES='DEBUG')
|
|
|
|
tlist = debugEnv.Program(target = 'm5.debug',
|
|
|
|
source = make_objs(sources, debugEnv))
|
|
|
|
debugEnv.M5Binary = tlist[0]
|
2004-07-03 06:16:38 +02:00
|
|
|
|
|
|
|
# Optimized binary
|
2005-09-05 22:31:27 +02:00
|
|
|
optEnv = env.Copy()
|
|
|
|
optEnv.Label = 'opt'
|
2006-04-18 19:49:23 +02:00
|
|
|
optEnv.Append(CCFLAGS=Split('-g -O3'))
|
2005-09-05 22:31:27 +02:00
|
|
|
tlist = optEnv.Program(target = 'm5.opt',
|
|
|
|
source = make_objs(sources, optEnv))
|
|
|
|
optEnv.M5Binary = tlist[0]
|
2004-07-03 06:16:38 +02:00
|
|
|
|
|
|
|
# "Fast" binary
|
2005-09-05 22:31:27 +02:00
|
|
|
fastEnv = env.Copy(OBJSUFFIX='.fo')
|
|
|
|
fastEnv.Label = 'fast'
|
2006-04-18 19:49:23 +02:00
|
|
|
fastEnv.Append(CCFLAGS=Split('-O3'))
|
2005-09-05 22:31:27 +02:00
|
|
|
fastEnv.Append(CPPDEFINES='NDEBUG')
|
|
|
|
fastEnv.Program(target = 'm5.fast.unstripped',
|
|
|
|
source = make_objs(sources, fastEnv))
|
|
|
|
tlist = fastEnv.Command(target = 'm5.fast',
|
|
|
|
source = 'm5.fast.unstripped',
|
|
|
|
action = 'strip $SOURCE -o $TARGET')
|
|
|
|
fastEnv.M5Binary = tlist[0]
|
2004-07-03 06:16:38 +02:00
|
|
|
|
|
|
|
# Profiled binary
|
2005-09-05 22:31:27 +02:00
|
|
|
profEnv = env.Copy(OBJSUFFIX='.po')
|
|
|
|
profEnv.Label = 'prof'
|
2006-04-18 19:49:23 +02:00
|
|
|
profEnv.Append(CCFLAGS=Split('-O3 -g -pg'), LINKFLAGS='-pg')
|
2005-09-05 22:31:27 +02:00
|
|
|
tlist = profEnv.Program(target = 'm5.prof',
|
|
|
|
source = make_objs(sources, profEnv))
|
|
|
|
profEnv.M5Binary = tlist[0]
|
|
|
|
|
|
|
|
envList = [debugEnv, optEnv, fastEnv, profEnv]
|
|
|
|
|
|
|
|
Return('envList')
|