-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.scons
73 lines (64 loc) · 2.04 KB
/
main.scons
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import os
env = Environment()
env['CXX'] = '/usr/bin/g++-7'
wrapper = 'maestro-wrapper'
maestro = os.path.join(wrapper, 'maestro')
spotlight_lib_with_main = False
debug = False
includes = f'''.
./{maestro}/cost-model/include
./{maestro}/cost-model/include/base
./{maestro}/cost-model/include/tools
./{maestro}/cost-model/include/user-api
./{maestro}/cost-model/include/dataflow-analysis
./{maestro}/cost-model/include/dataflow-specification-language
./{maestro}/cost-model/include/design-space-exploration
./{maestro}/cost-model/include/cost-analysis
./{maestro}/cost-model/include/abstract-hardware-model
./{maestro}/cost-model/src'''
env.Append(LINKFLAGS=[
'-lboost_program_options',
'-lboost_filesystem',
'-lboost_system'
])
env.Append(CXXFLAGS=[
'-std=c++17',
'-lboost_program_options',
'-lboost_filesystem',
'-lboost_system',
'-g' if debug else '-O3',
'-Wall',
'-Wextra'
])
env.Append(LIBS=[
'-lboost_program_options',
'-lboost_filesystem',
'-lboost_system'
])
env.Append(CPPPATH = Split(includes))
env.Program('maestro', [
f'{maestro}/maestro-top.cpp',
f'{maestro}/cost-model/src/BASE_base-objects.cpp'
])
env.Append(LIBS=['-lpthread'])
env.Append(CXXFLAGS=['-D_SPOTLIGHT'])
if debug:
env.Append(CXXFLAGS=['-D_DEBUG_OUT', '-D_VERBOSE'])
if spotlight_lib_with_main:
env.Append(CXXFLAGS=['-D_WITH_MAIN'])
env.Program('spotlight', [
f'{wrapper}/spotlight-lib.cpp',
f'{wrapper}/spotlight-common.cpp',
f'{maestro}/cost-model/src/BASE_base-objects.cpp'
])
else:
env.Program('spotlight', [
f'{wrapper}/spotlight-top.cpp',
f'{wrapper}/spotlight-common.cpp',
f'{maestro}/cost-model/src/BASE_base-objects.cpp'
])
env.SharedLibrary('spotlight', [
f'{wrapper}/spotlight-lib.cpp',
f'{wrapper}/spotlight-common.cpp',
f'{maestro}/cost-model/src/BASE_base-objects.cpp'
])