@@ -62,11 +62,11 @@ def create_mbed_ignore(build_dir):
62
62
f .write ('*\n ' )
63
63
64
64
65
- def build_mbed_spm_platform (target , toolchain ):
65
+ def build_mbed_spm_platform (target , toolchain , profile = 'release' ):
66
66
subprocess .call ([
67
67
sys .executable , '-u' , TEST_PY_LOCATTION ,
68
68
'--greentea' ,
69
- '--profile' , 'debug' ,
69
+ '--profile' , profile ,
70
70
'-t' , toolchain ,
71
71
'-m' , target ,
72
72
'--source' , ROOT ,
@@ -80,7 +80,7 @@ def build_mbed_spm_platform(target, toolchain):
80
80
sys .executable , '-u' , MAKE_PY_LOCATTION ,
81
81
'-t' , toolchain ,
82
82
'-m' , target ,
83
- '--profile' , 'release' ,
83
+ '--profile' , profile ,
84
84
'--source' , ROOT ,
85
85
'--build' , os .path .join (ROOT , 'BUILD' , target ),
86
86
'--artifact-name' , 'psa_release_1.0'
@@ -91,12 +91,12 @@ def _tfm_test_defines(test):
91
91
return ['-D{}' .format (define ) for define in TFM_TESTS [test ]]
92
92
93
93
94
- def build_tfm_platform (target , toolchain ):
94
+ def build_tfm_platform (target , toolchain , profile = 'release' ):
95
95
for test in TFM_TESTS .keys ():
96
96
subprocess .call ([
97
97
sys .executable , '-u' , TEST_PY_LOCATTION ,
98
98
'--greentea' ,
99
- '--profile' , 'debug' ,
99
+ '--profile' , profile ,
100
100
'-t' , toolchain ,
101
101
'-m' , target ,
102
102
'--source' , ROOT ,
@@ -109,18 +109,19 @@ def build_tfm_platform(target, toolchain):
109
109
sys .executable , '-u' , MAKE_PY_LOCATTION ,
110
110
'-t' , toolchain ,
111
111
'-m' , target ,
112
- '--profile' , 'release' ,
112
+ '--profile' , profile ,
113
113
'--source' , ROOT ,
114
114
'--build' , os .path .join (ROOT , 'BUILD' , target ),
115
115
'--app-config' , TFM_MBED_APP
116
116
])
117
117
118
118
119
- def build_psa_platform (target , toolchain ):
119
+ def build_psa_platform (target , toolchain , debug = False ):
120
+ profile = 'debug' if debug else 'release'
120
121
if _psa_backend (target ) is 'TFM' :
121
- build_tfm_platform (target , toolchain )
122
+ build_tfm_platform (target , toolchain , profile )
122
123
else :
123
- build_mbed_spm_platform (target , toolchain )
124
+ build_mbed_spm_platform (target , toolchain , profile )
124
125
125
126
126
127
def get_parser ():
@@ -130,6 +131,11 @@ def get_parser():
130
131
default = '*' ,
131
132
metavar = "MCU" )
132
133
134
+ parser .add_argument ("-d" , "--debug" ,
135
+ help = "build for the given MCU" ,
136
+ action = "store_true" ,
137
+ default = False )
138
+
133
139
return parser
134
140
135
141
@@ -156,7 +162,7 @@ def main():
156
162
target_filter_function = filter_target (options .mcu )
157
163
158
164
for target , toolchain in filter (target_filter_function , psa_platforms_list ):
159
- build_psa_platform (target , toolchain )
165
+ build_psa_platform (target , toolchain , options . debug )
160
166
161
167
162
168
if __name__ == '__main__' :
0 commit comments