29
29
from tools .utils import NotSupportedException
30
30
from tools .targets import TARGET_MAP
31
31
32
+ SHELL_ESCAPE_TABLE = {
33
+ "(" : "\(" ,
34
+ ")" : "\)" ,
35
+ }
36
+
37
+
38
+ def shell_escape (string ):
39
+ return "" .join (SHELL_ESCAPE_TABLE .get (char , char ) for char in string )
40
+
32
41
33
42
class Makefile (Exporter ):
34
43
"""Generic Makefile template that mimics the behavior of the python build
@@ -88,18 +97,16 @@ def generate(self):
88
97
if (basename (dirname (dirname (self .export_dir )))
89
98
== "projectfiles" )
90
99
else [".." ]),
91
- 'cc_cmd' : " " .join ([basename (self .toolchain .cc [0 ])] +
92
- self .toolchain .cc [1 :]),
93
- 'cppc_cmd' : " " .join ([basename (self .toolchain .cppc [0 ])] +
94
- self .toolchain .cppc [1 :]),
95
- 'asm_cmd' : " " .join ([basename (self .toolchain .asm [0 ])] +
96
- self .toolchain .asm [1 :]),
100
+ 'cc_cmd' : basename (self .toolchain .cc [0 ]),
101
+ 'cppc_cmd' : basename (self .toolchain .cppc [0 ]),
102
+ 'asm_cmd' : basename (self .toolchain .asm [0 ]),
97
103
'ld_cmd' : basename (self .toolchain .ld [0 ]),
98
104
'elf2bin_cmd' : basename (self .toolchain .elf2bin ),
99
105
'link_script_ext' : self .toolchain .LINKER_EXT ,
100
106
'link_script_option' : self .LINK_SCRIPT_OPTION ,
101
107
'user_library_flag' : self .USER_LIBRARY_FLAG ,
102
108
'needs_asm_preproc' : self .PREPROCESS_ASM ,
109
+ 'shell_escape' : shell_escape ,
103
110
}
104
111
105
112
if hasattr (self .toolchain , "preproc" ):
@@ -123,6 +130,9 @@ def generate(self):
123
130
'to_be_compiled' ]:
124
131
ctx [key ] = sorted (ctx [key ])
125
132
ctx .update (self .format_flags ())
133
+ ctx ['asm_flags' ].extend (self .toolchain .asm [1 :])
134
+ ctx ['c_flags' ].extend (self .toolchain .cc [1 :])
135
+ ctx ['cxx_flags' ].extend (self .toolchain .cppc [1 :])
126
136
127
137
# Add the virtual path the the include option in the ASM flags
128
138
new_asm_flags = []
@@ -265,17 +275,6 @@ class Armc6(Arm):
265
275
NAME = 'Make-ARMc6'
266
276
TOOLCHAIN = "ARMC6"
267
277
268
- @classmethod
269
- def is_target_supported (cls , target_name ):
270
- target = TARGET_MAP [target_name ]
271
- if target .core in (
272
- "Cortex-M23" , "Cortex-M23-NS" ,
273
- "Cortex-M33" , "Cortex-M33-NS"
274
- ):
275
- return False
276
- return apply_supported_whitelist (
277
- cls .TOOLCHAIN , cls .POST_BINARY_WHITELIST , target )
278
-
279
278
280
279
class IAR (Makefile ):
281
280
"""IAR specific makefile target"""
0 commit comments