Skip to content

Commit 387747f

Browse files
committed
Implement Linker command/response files in make export
1 parent 5d5ca62 commit 387747f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tools/export/makefile/Makefile.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ $(PROJECT).link_script{{link_script_ext}}: $(LINKER_SCRIPT)
135135

136136
{% block target_project_elf %}
137137
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) {% if pp_cmd -%} $(PROJECT).link_script{{link_script_ext}} {% else%} $(LINKER_SCRIPT) {% endif %}
138+
$(file > [email protected], $(filter %.o, $^))
138139
+@echo "link: $(notdir $@)"
139-
@$(LD) $(LD_FLAGS) {{link_script_option}} $(filter-out %.o, $^) $(LIBRARY_PATHS) --output $@ $(filter %.o, $^) $(LIBRARIES) $(LD_SYS_LIBS)
140+
@$(LD) $(LD_FLAGS) {{link_script_option}} $(filter-out %.o, $^) $(LIBRARY_PATHS) --output $@ {{response_option}}[email protected] $(LIBRARIES) $(LD_SYS_LIBS)
140141
{% endblock %}
141142

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

tools/export/makefile/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def generate(self):
100100
'link_script_option': self.LINK_SCRIPT_OPTION,
101101
'user_library_flag': self.USER_LIBRARY_FLAG,
102102
'needs_asm_preproc': self.PREPROCESS_ASM,
103+
'response_option': self.RESPONSE_OPTION,
103104
}
104105

105106
if hasattr(self.toolchain, "preproc"):
@@ -217,6 +218,7 @@ class GccArm(Makefile):
217218
TOOLCHAIN = "GCC_ARM"
218219
LINK_SCRIPT_OPTION = "-T"
219220
USER_LIBRARY_FLAG = "-L"
221+
RESPONSE_OPTION = "@"
220222

221223
@staticmethod
222224
def prepare_lib(libname):
@@ -234,6 +236,7 @@ class Arm(Makefile):
234236
LINK_SCRIPT_OPTION = "--scatter"
235237
USER_LIBRARY_FLAG = "--userlibpath "
236238
TEMPLATE = 'make-arm'
239+
RESPONSE_OPTION = "--via "
237240

238241
@staticmethod
239242
def prepare_lib(libname):
@@ -284,6 +287,7 @@ class IAR(Makefile):
284287
TOOLCHAIN = "IAR"
285288
LINK_SCRIPT_OPTION = "--config"
286289
USER_LIBRARY_FLAG = "-L"
290+
RESPONSE_OPTION = "-f "
287291

288292
@staticmethod
289293
def prepare_lib(libname):

0 commit comments

Comments
 (0)