mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #7559 from theotherjimmy/make-armc6-v8m
Export: Support Make + ArmC6 + v8mpull/7747/merge
commit
2a824a1ceb
|
|
@ -75,11 +75,11 @@ SREC_CAT = srec_cat
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- block additional_executables -%}{%- endblock %}
|
{%- block additional_executables -%}{%- endblock %}
|
||||||
|
|
||||||
{% for flag in c_flags %}C_FLAGS += {{flag}}
|
{% for flag in c_flags %}C_FLAGS += {{shell_escape(flag)}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for flag in cxx_flags %}CXX_FLAGS += {{flag}}
|
{% for flag in cxx_flags %}CXX_FLAGS += {{shell_escape(flag)}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for flag in asm_flags %}ASM_FLAGS += {{flag}}
|
{% for flag in asm_flags %}ASM_FLAGS += {{shell_escape(flag)}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
LD_FLAGS :={%- block ld_flags -%} {{ld_flags|join(" ")}} {% endblock %}
|
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.utils import NotSupportedException
|
||||||
from tools.targets import TARGET_MAP
|
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):
|
class Makefile(Exporter):
|
||||||
"""Generic Makefile template that mimics the behavior of the python build
|
"""Generic Makefile template that mimics the behavior of the python build
|
||||||
|
|
@ -88,18 +97,16 @@ class Makefile(Exporter):
|
||||||
if (basename(dirname(dirname(self.export_dir)))
|
if (basename(dirname(dirname(self.export_dir)))
|
||||||
== "projectfiles")
|
== "projectfiles")
|
||||||
else [".."]),
|
else [".."]),
|
||||||
'cc_cmd': " ".join([basename(self.toolchain.cc[0])] +
|
'cc_cmd': basename(self.toolchain.cc[0]),
|
||||||
self.toolchain.cc[1:]),
|
'cppc_cmd': basename(self.toolchain.cppc[0]),
|
||||||
'cppc_cmd': " ".join([basename(self.toolchain.cppc[0])] +
|
'asm_cmd': basename(self.toolchain.asm[0]),
|
||||||
self.toolchain.cppc[1:]),
|
|
||||||
'asm_cmd': " ".join([basename(self.toolchain.asm[0])] +
|
|
||||||
self.toolchain.asm[1:]),
|
|
||||||
'ld_cmd': basename(self.toolchain.ld[0]),
|
'ld_cmd': basename(self.toolchain.ld[0]),
|
||||||
'elf2bin_cmd': basename(self.toolchain.elf2bin),
|
'elf2bin_cmd': basename(self.toolchain.elf2bin),
|
||||||
'link_script_ext': self.toolchain.LINKER_EXT,
|
'link_script_ext': self.toolchain.LINKER_EXT,
|
||||||
'link_script_option': self.LINK_SCRIPT_OPTION,
|
'link_script_option': self.LINK_SCRIPT_OPTION,
|
||||||
'user_library_flag': self.USER_LIBRARY_FLAG,
|
'user_library_flag': self.USER_LIBRARY_FLAG,
|
||||||
'needs_asm_preproc': self.PREPROCESS_ASM,
|
'needs_asm_preproc': self.PREPROCESS_ASM,
|
||||||
|
'shell_escape': shell_escape,
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasattr(self.toolchain, "preproc"):
|
if hasattr(self.toolchain, "preproc"):
|
||||||
|
|
@ -123,6 +130,9 @@ class Makefile(Exporter):
|
||||||
'to_be_compiled']:
|
'to_be_compiled']:
|
||||||
ctx[key] = sorted(ctx[key])
|
ctx[key] = sorted(ctx[key])
|
||||||
ctx.update(self.format_flags())
|
ctx.update(self.format_flags())
|
||||||
|
ctx['asm_flags'].extend(self.toolchain.asm[1:])
|
||||||
|
ctx['c_flags'].extend(self.toolchain.cc[1:])
|
||||||
|
ctx['cxx_flags'].extend(self.toolchain.cppc[1:])
|
||||||
|
|
||||||
# Add the virtual path the the include option in the ASM flags
|
# Add the virtual path the the include option in the ASM flags
|
||||||
new_asm_flags = []
|
new_asm_flags = []
|
||||||
|
|
@ -265,17 +275,6 @@ class Armc6(Arm):
|
||||||
NAME = 'Make-ARMc6'
|
NAME = 'Make-ARMc6'
|
||||||
TOOLCHAIN = "ARMC6"
|
TOOLCHAIN = "ARMC6"
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def is_target_supported(cls, target_name):
|
|
||||||
target = TARGET_MAP[target_name]
|
|
||||||
if target.core in (
|
|
||||||
"Cortex-M23", "Cortex-M23-NS",
|
|
||||||
"Cortex-M33", "Cortex-M33-NS"
|
|
||||||
):
|
|
||||||
return False
|
|
||||||
return apply_supported_whitelist(
|
|
||||||
cls.TOOLCHAIN, cls.POST_BINARY_WHITELIST, target)
|
|
||||||
|
|
||||||
|
|
||||||
class IAR(Makefile):
|
class IAR(Makefile):
|
||||||
"""IAR specific makefile target"""
|
"""IAR specific makefile target"""
|
||||||
|
|
|
||||||
|
|
@ -352,7 +352,7 @@ class Resources(object):
|
||||||
def linker_script(self):
|
def linker_script(self):
|
||||||
options = self.get_file_names(FileType.LD_SCRIPT)
|
options = self.get_file_names(FileType.LD_SCRIPT)
|
||||||
if options:
|
if options:
|
||||||
return options[-1]
|
return options[0]
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue