Skip to content

Commit 06b0068

Browse files
committed
Genericify arm compiler exporter to versions 5 + 6
1 parent e9d3166 commit 06b0068

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

tools/export/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
'gcc_arm': makefile.GccArm,
4343
'make_gcc_arm': makefile.GccArm,
4444
'make_armc5': makefile.Armc5,
45+
'make_armc6': makefile.Armc6,
4546
'make_iar': makefile.IAR,
4647
'ds5_5': ds5_5.DS5_5,
4748
'iar': iar.IAR,

tools/export/makefile/Makefile.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ $(PROJECT).link_script{{link_script_ext}}: $(LINKER_SCRIPT)
130130
{% block target_project_elf %}
131131
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) {% if pp_cmd -%} $(PROJECT).link_script{{link_script_ext}} {% else%} $(LINKER_SCRIPT) {% endif %}
132132
+@echo "link: $(notdir $@)"
133-
@$(LD) $(LD_FLAGS) {{link_script_option}} $(filter %{{link_script_ext}}, $^) $(LIBRARY_PATHS) --output $@ $(filter %.o, $^) $(LIBRARIES) $(LD_SYS_LIBS)
133+
@$(LD) $(LD_FLAGS) {{link_script_option}} $(filter-out %.o, $^) $(LIBRARY_PATHS) --output $@ $(filter %.o, $^) $(LIBRARIES) $(LD_SYS_LIBS)
134134
{% endblock %}
135135

136136
$(PROJECT).bin: $(PROJECT).elf

tools/export/makefile/__init__.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,11 @@ def prepare_sys_lib(libname):
209209
return "-l" + libname
210210

211211

212-
class Armc5(Makefile):
213-
"""ARM Compiler 5 specific makefile target"""
214-
NAME = 'Make-ARMc5'
215-
TEMPLATE = 'make-armc5'
216-
TOOLCHAIN = "ARM"
212+
class Arm(Makefile):
213+
"""ARM Compiler generic makefile target"""
217214
LINK_SCRIPT_OPTION = "--scatter"
218215
USER_LIBRARY_FLAG = "--userlibpath "
216+
TEMPLATE = 'make-arm'
219217

220218
@staticmethod
221219
def prepare_lib(libname):
@@ -225,6 +223,25 @@ def prepare_lib(libname):
225223
def prepare_sys_lib(libname):
226224
return libname
227225

226+
def generate(self):
227+
if self.resources.linker_script:
228+
new_script = self.toolchain.make_real_scatter(
229+
self.resources.linker_script)
230+
if new_script is not self.resources.linker_script:
231+
self.resources.linker_script = new_script
232+
self.generated_files.append(new_script)
233+
return super(Arm, self).generate()
234+
235+
class Armc5(Arm):
236+
"""ARM Compiler 5 (armcc) specific makefile target"""
237+
NAME = 'Make-ARMc5'
238+
TOOLCHAIN = "ARM"
239+
240+
class Armc6(Arm):
241+
"""ARM Compiler 6 (armclang) specific generic makefile target"""
242+
NAME = 'Make-ARMc6'
243+
TOOLCHAIN = "ARMC6"
244+
228245

229246
class IAR(Makefile):
230247
"""IAR specific makefile target"""

0 commit comments

Comments
 (0)