mirror of https://github.com/ARMmbed/mbed-os.git
Use shell escaping instead of quoting
OSs don't agree on what the quote chars meanpull/7559/head
parent
6adac922db
commit
58180dbafe
|
@ -75,11 +75,11 @@ SREC_CAT = srec_cat
|
|||
{%- endif %}
|
||||
{%- block additional_executables -%}{%- endblock %}
|
||||
|
||||
{% for flag in c_flags %}C_FLAGS += "{{flag}}"
|
||||
{% for flag in c_flags %}C_FLAGS += {{shell_escape(flag)}}
|
||||
{% endfor %}
|
||||
{% for flag in cxx_flags %}CXX_FLAGS += "{{flag}}"
|
||||
{% for flag in cxx_flags %}CXX_FLAGS += {{shell_escape(flag)}}
|
||||
{% endfor %}
|
||||
{% for flag in asm_flags %}ASM_FLAGS += "{{flag}}"
|
||||
{% for flag in asm_flags %}ASM_FLAGS += {{shell_escape(flag)}}
|
||||
{% endfor %}
|
||||
|
||||
LD_FLAGS :={%- block ld_flags -%} {{ld_flags|join(" ")}} {% endblock %}
|
||||
|
|
|
@ -29,6 +29,15 @@ from tools.export.exporters import Exporter, apply_supported_whitelist
|
|||
from tools.utils import NotSupportedException
|
||||
from tools.targets import TARGET_MAP
|
||||
|
||||
SHELL_ESCAPE_TABLE = {
|
||||
"(": "\(",
|
||||
")": "\)",
|
||||
}
|
||||
|
||||
|
||||
def shell_escape(string):
|
||||
return "".join(SHELL_ESCAPE_TABLE.get(char, char) for char in string)
|
||||
|
||||
|
||||
class Makefile(Exporter):
|
||||
"""Generic Makefile template that mimics the behavior of the python build
|
||||
|
@ -97,6 +106,7 @@ class Makefile(Exporter):
|
|||
'link_script_option': self.LINK_SCRIPT_OPTION,
|
||||
'user_library_flag': self.USER_LIBRARY_FLAG,
|
||||
'needs_asm_preproc': self.PREPROCESS_ASM,
|
||||
'shell_escape': shell_escape,
|
||||
}
|
||||
|
||||
if hasattr(self.toolchain, "preproc"):
|
||||
|
|
Loading…
Reference in New Issue