a896a34e44b5097fc9fc6e85e4cd3bf552fb4578
[gem5.git] / util / tlm / examples / master_port / 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 # Authors: Christian Menard
34
35 import os
36
37 gem5_arch = 'ARM'
38 gem5_variant = 'opt'
39 #gem5_variant = 'debug'
40
41 gem5_root = '#../../../..'
42
43 target = 'gem5.' + gem5_variant + '.sc'
44
45 env = Environment()
46
47 # Import PKG_CONFIG_PATH from the external environment
48 if os.environ.has_key('PKG_CONFIG_PATH'):
49 env['ENV']['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH']
50
51 # search for SystemC
52 env.ParseConfig('pkg-config --cflags --libs systemc')
53
54 # add include dirs
55 env.Append(CPPPATH=[gem5_root + '/build/' + gem5_arch,
56 gem5_root + '/util/systemc',
57 gem5_root + '/util/tlm',
58 '../common'])
59
60 env.Append(LIBS=['gem5_' + gem5_variant])
61 env.Append(LIBPATH=[gem5_root + '/build/' + gem5_arch])
62
63 env.Append(CXXFLAGS=['-std=c++11',
64 '-DSC_INCLUDE_DYNAMIC_PROCESSES',
65 '-DTRACING_ON'])
66
67 if gem5_variant == 'debug':
68 env.Append(CXXFLAGS=['-g', '-DDEBUG'])
69
70 src_systemc = [gem5_root + '/util/systemc/sc_gem5_control.cc',
71 gem5_root + '/util/systemc/sc_logger.cc',
72 gem5_root + '/util/systemc/sc_module.cc',
73 gem5_root + '/util/systemc/stats.cc']
74
75 src_tlm = Glob(gem5_root + '/util/tlm/*.cc')
76 src_main = Glob('*.cc') + Glob('../common/*.cc')
77
78 main = env.Program(target, src_systemc + src_tlm + src_main)