-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSConstruct.py
112 lines (97 loc) · 1.91 KB
/
SConstruct.py
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# ruff: noqa: F821
import os
import env as uenv
EnsureSConsVersion(4, 7, 0)
EnsurePythonVersion(3, 12)
build = 'build'
AddOption(
'--esp-baud',
default='',
help='serial port baud rate for flashing/reading',
metavar='BAUD',
type=str,
)
AddOption(
'--esp-port',
default='',
help='serial port device',
metavar='PORT',
type=str,
)
AddOption(
'--verbose',
action='store_true',
default=False,
help='enable verbose output',
)
env = Environment(
ENV={
**uenv.ENV,
'PATH': os.environ['PATH'],
'PYTHONPATH': os.environ.get('PYTHONPATH'),
'TERM': os.environ.get('TERM'),
},
ESPBAUD=GetOption('esp_baud'),
ESPPORT=GetOption('esp_port'),
VERBOSE=GetOption('verbose'),
tools=[
'default',
'Component',
'EspIdf',
'OpenCan',
'Phony',
'Project',
],
)
env.AppendUnique(
CCFLAGS=[
'-Wall',
'-Wextra',
'-Wpedantic',
'-ggdb',
'-std=gnu17',
]
)
env.AppendUnique(
PDFLATEXFLAGS=[
'--halt-on-error',
'--shell-escape',
]
)
env.Replace(PDFLATEX='lualatex')
if not env['VERBOSE']:
commands = [
'AR',
'CC',
'RANLIB',
]
for command in commands:
env[f'{command}COMSTR'] = f'{command} $TARGET'
esp32s3 = uenv.idf(env, 'esp32s3')
envs = {
'env': env,
'esp32s3': esp32s3,
}
Export('env')
Export('envs')
can = env.SConscript(
'can/SConscript.py',
variant_dir=f'{build}/can',
)
lib = env.SConscript(
'lib/SConscript.py',
variant_dir=f'{build}/lib',
)
components = env.SConscript(
'components/SConscript.py',
variant_dir=f'{build}/components',
)
ember_bl = env.SConscript(
'dbw/ember_bl/SConscript.py',
variant_dir=f'{build}/dbw/ember_bl',
duplicate=False,
)
projects = env.SConscript(
'projects/SConscript.py',
variant_dir=f'{build}/projects',
)