mirror of https://github.com/ARMmbed/mbed-os.git
Genericify arm compiler exporter to versions 5 + 6
parent
e9d3166a5e
commit
06b00683c3
|
@ -42,6 +42,7 @@ EXPORTERS = {
|
|||
'gcc_arm': makefile.GccArm,
|
||||
'make_gcc_arm': makefile.GccArm,
|
||||
'make_armc5': makefile.Armc5,
|
||||
'make_armc6': makefile.Armc6,
|
||||
'make_iar': makefile.IAR,
|
||||
'ds5_5': ds5_5.DS5_5,
|
||||
'iar': iar.IAR,
|
||||
|
|
|
@ -130,7 +130,7 @@ $(PROJECT).link_script{{link_script_ext}}: $(LINKER_SCRIPT)
|
|||
{% block target_project_elf %}
|
||||
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) {% if pp_cmd -%} $(PROJECT).link_script{{link_script_ext}} {% else%} $(LINKER_SCRIPT) {% endif %}
|
||||
+@echo "link: $(notdir $@)"
|
||||
@$(LD) $(LD_FLAGS) {{link_script_option}} $(filter %{{link_script_ext}}, $^) $(LIBRARY_PATHS) --output $@ $(filter %.o, $^) $(LIBRARIES) $(LD_SYS_LIBS)
|
||||
@$(LD) $(LD_FLAGS) {{link_script_option}} $(filter-out %.o, $^) $(LIBRARY_PATHS) --output $@ $(filter %.o, $^) $(LIBRARIES) $(LD_SYS_LIBS)
|
||||
{% endblock %}
|
||||
|
||||
$(PROJECT).bin: $(PROJECT).elf
|
||||
|
|
|
@ -209,13 +209,11 @@ class GccArm(Makefile):
|
|||
return "-l" + libname
|
||||
|
||||
|
||||
class Armc5(Makefile):
|
||||
"""ARM Compiler 5 specific makefile target"""
|
||||
NAME = 'Make-ARMc5'
|
||||
TEMPLATE = 'make-armc5'
|
||||
TOOLCHAIN = "ARM"
|
||||
class Arm(Makefile):
|
||||
"""ARM Compiler generic makefile target"""
|
||||
LINK_SCRIPT_OPTION = "--scatter"
|
||||
USER_LIBRARY_FLAG = "--userlibpath "
|
||||
TEMPLATE = 'make-arm'
|
||||
|
||||
@staticmethod
|
||||
def prepare_lib(libname):
|
||||
|
@ -225,6 +223,25 @@ class Armc5(Makefile):
|
|||
def prepare_sys_lib(libname):
|
||||
return libname
|
||||
|
||||
def generate(self):
|
||||
if self.resources.linker_script:
|
||||
new_script = self.toolchain.make_real_scatter(
|
||||
self.resources.linker_script)
|
||||
if new_script is not self.resources.linker_script:
|
||||
self.resources.linker_script = new_script
|
||||
self.generated_files.append(new_script)
|
||||
return super(Arm, self).generate()
|
||||
|
||||
class Armc5(Arm):
|
||||
"""ARM Compiler 5 (armcc) specific makefile target"""
|
||||
NAME = 'Make-ARMc5'
|
||||
TOOLCHAIN = "ARM"
|
||||
|
||||
class Armc6(Arm):
|
||||
"""ARM Compiler 6 (armclang) specific generic makefile target"""
|
||||
NAME = 'Make-ARMc6'
|
||||
TOOLCHAIN = "ARMC6"
|
||||
|
||||
|
||||
class IAR(Makefile):
|
||||
"""IAR specific makefile target"""
|
||||
|
|
Loading…
Reference in New Issue