3 # Copyright (c) 2016, Dresden University of Technology (TU Dresden)
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are
10 # 1. Redistributions of source code must retain the above copyright notice,
11 # this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
17 # 3. Neither the name of the copyright holder nor the names of its
18 # contributors may be used to endorse or promote products derived from
19 # this software without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
25 # OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 # Authors: Christian Menard
41 #gem5_variant = 'debug'
43 gem5_root
= Dir('#../..').srcnode().abspath
47 #Make the gem5 root available in SConscripts
48 env
['GEM5_ROOT'] = gem5_root
50 shlibsuffix
= env
['SHLIBSUFFIX']
53 env
.Append(CPPPATH
=[gem5_root
+ '/build/' + gem5_arch
,
54 gem5_root
+ '/util/systemc',
55 gem5_root
+ '/ext/systemc/src',
60 env
.Append(CXXFLAGS
=['-std=c++11',
61 '-DSC_INCLUDE_DYNAMIC_PROCESSES',
65 if gem5_variant
== 'debug':
66 env
.Append(CXXFLAGS
=['-g', '-DDEBUG'])
68 deps
= [] # keep track of all dependencies required for building the binaries
70 deps
+= SConscript('src/SConscript', variant_dir
='build/tlm', exports
='env')
72 deps
+= SConscript('examples/common/SConscript',
73 variant_dir
='build/examples/common',
76 # the SystemC SConscript makes certain assumptions, we need to fulfill these
77 # assumptions before calling the SConscript.
79 sys
.path
.append(gem5_root
+ '/src/python')
80 AddOption('--no-colors', dest
='use_colors', action
='store_false',
81 help="Don't add color to abbreviated scons output")
83 SConscript(gem5_root
+ '/ext/systemc/SConscript',
84 variant_dir
='build/systemc',
87 # By adding libraries as dependencies instead of using LIBS, we avoid that
88 # the user needs to set the LD_LIBRARY_PATH
89 deps
.append(File('build/systemc/libsystemc' + shlibsuffix
))
90 deps
.append(File(os
.path
.join(gem5_root
, 'build', gem5_arch
,
91 'libgem5_' + gem5_variant
+ shlibsuffix
)))
93 ex_master
= SConscript('examples/master_port/SConscript',
94 variant_dir
='build/examples/master_port',
95 exports
=['env', 'deps'])
97 ex_slave
= SConscript('examples/slave_port/SConscript',
98 variant_dir
='build/examples/slave_port',
99 exports
=['env', 'deps'])
101 Default(ex_master
+ ex_slave
)