-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConscript
More file actions
50 lines (39 loc) · 2.1 KB
/
Copy pathSConscript
File metadata and controls
50 lines (39 loc) · 2.1 KB
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
import os
from building import *
cwd = GetCurrentDir()
# ---------------------------------------------------------------------------
# Core library + RT-Thread port.
#
# The RamTrace core implements the __cyg_profile_func_enter/exit hooks itself,
# so both the core and the port are compiled with -fno-instrument-functions to
# avoid re-entrant instrumentation. Only application code that the user wants
# to trace (the demo workload below) is compiled with -finstrument-functions.
# ---------------------------------------------------------------------------
core_src = Glob( os.path.join( cwd, 'ram_trace', 'src', '*.c' ) )
port_src = Glob( os.path.join( cwd, 'ram_trace', 'ports', 'rtthread', '*.c' ) )
CPPPATH = [
os.path.join( cwd, 'ram_trace', 'include' ),
os.path.join( cwd, 'ram_trace', 'ports', 'rtthread' ),
]
group = DefineGroup( 'RamTrace', core_src + port_src,
depend = [ 'PKG_USING_MRAMTRACE' ],
CPPPATH = CPPPATH,
LOCAL_CFLAGS = ' -fno-instrument-functions' )
# ---------------------------------------------------------------------------
# Optional demo.
# ---------------------------------------------------------------------------
if GetDepend( 'PKG_MRAMTRACE_USING_DEMO' ):
demo_cwd = os.path.join( cwd, 'examples', 'rt-thread' )
demo_cpppath = [ demo_cwd ]
demo_src = Glob( os.path.join( demo_cwd, 'ram_trace_demo.c' ) )
workload_src = Glob( os.path.join( demo_cwd, 'workload.c' ) )
demo_group = DefineGroup( 'RamTraceDemo', demo_src,
depend = [ 'PKG_MRAMTRACE_USING_DEMO' ],
CPPPATH = demo_cpppath,
LOCAL_CFLAGS = ' -fno-instrument-functions' )
workload_group = DefineGroup( 'RamTraceWorkload', workload_src,
depend = [ 'PKG_MRAMTRACE_USING_DEMO' ],
CPPPATH = demo_cpppath,
LOCAL_CFLAGS = ' -finstrument-functions -fno-inline -fno-optimize-sibling-calls -fno-ipa-icf' )
group = group + demo_group + workload_group
Return( 'group' )