util: Delete authors lists from files in util.
[gem5.git] / util / tlm / SConstruct
1 #!python
2
3 # Copyright (c) 2016, Dresden University of Technology (TU Dresden)
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are
8 # met:
9 #
10 # 1. Redistributions of source code must retain the above copyright notice,
11 # this list of conditions and the following disclaimer.
12 #
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.
16 #
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.
20 #
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.
32
33 import os
34 import sys
35
36
37 gem5_arch = 'ARM'
38 gem5_variant = 'opt'
39 #gem5_variant = 'debug'
40
41 gem5_root = Dir('#../..').srcnode().abspath
42
43 env = Environment()
44
45 #Make the gem5 root available in SConscripts
46 env['GEM5_ROOT'] = gem5_root
47
48 shlibsuffix = env['SHLIBSUFFIX']
49
50 # add include dirs
51 env.Append(CPPPATH=[gem5_root + '/build/' + gem5_arch,
52 gem5_root + '/util/systemc/gem5_within_systemc',
53 gem5_root + '/ext/systemc/src',
54 '#src',
55 '#examples/common',
56 ])
57
58 env.Append(CXXFLAGS=['-std=c++11',
59 '-DSC_INCLUDE_DYNAMIC_PROCESSES',
60 '-DTRACING_ON',
61 ])
62
63 if gem5_variant == 'debug':
64 env.Append(CXXFLAGS=['-g', '-DDEBUG'])
65
66 deps = [] # keep track of all dependencies required for building the binaries
67
68 deps += SConscript('src/SConscript', variant_dir='build/tlm', exports='env')
69
70 deps += SConscript('examples/common/SConscript',
71 variant_dir='build/examples/common',
72 exports=['env'])
73
74 # the SystemC SConscript makes certain assumptions, we need to fulfill these
75 # assumptions before calling the SConscript.
76 main = env
77 sys.path.append(gem5_root + '/src/python')
78 AddOption('--no-colors', dest='use_colors', action='store_false',
79 help="Don't add color to abbreviated scons output")
80
81 SConscript(gem5_root + '/ext/systemc/SConscript',
82 variant_dir='build/systemc',
83 exports='main')
84
85 # By adding libraries as dependencies instead of using LIBS, we avoid that
86 # the user needs to set the LD_LIBRARY_PATH
87 deps.append(File('build/systemc/libsystemc' + shlibsuffix))
88 deps.append(File(os.path.join(gem5_root, 'build', gem5_arch,
89 'libgem5_' + gem5_variant + shlibsuffix)))
90
91 ex_master = SConscript('examples/master_port/SConscript',
92 variant_dir='build/examples/master_port',
93 exports=['env', 'deps'])
94
95 ex_slave = SConscript('examples/slave_port/SConscript',
96 variant_dir='build/examples/slave_port',
97 exports=['env', 'deps'])
98
99 Default(ex_master + ex_slave)