Skip to content

Commit 6918e6a

Browse files
committed
makefile export: create .link_options.txt with echo
$(file > [email protected], $(filter %.o, $^)) is not supported in GNU Make 3.81. Create the linker response file with pipe redirect from echo command. This is tested with Cygwin make and make 3.8.1 shipped with macOS. Also, change the linker responce file name to .link_options.txt. This is an internal file, not a build artifact.
1 parent a8a21d3 commit 6918e6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/export/makefile/Makefile.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +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, $^))
138+
+@echo "$(filter %.o, $^)" > .link_options.txt
139139
+@echo "link: $(notdir $@)"
140-
@$(LD) $(LD_FLAGS) {{link_script_option}} $(filter-out %.o, $^) $(LIBRARY_PATHS) --output $@ {{response_option}}[email protected] $(LIBRARIES) $(LD_SYS_LIBS)
140+
@$(LD) $(LD_FLAGS) {{link_script_option}} $(filter-out %.o, $^) $(LIBRARY_PATHS) --output $@ {{response_option}}.link_options.txt $(LIBRARIES) $(LD_SYS_LIBS)
141141
{% endblock %}
142142

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

0 commit comments

Comments
 (0)