makefile export: create .link_options.txt with echo

$(file > $@.in, $(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.

(cherry picked from commit 6918e6a76b)

Revert "Fixed problem with overlong command line."

This reverts commit dd02ac09a1.

See also https://github.com/ARMmbed/mbed-os/pull/12646#issuecomment-602058273
pull/12666/head
Volodymyr Medvid 2019-02-04 20:10:39 +02:00 committed by David Hebbeker
parent 59540ed8c1
commit 26043e5ee4
No known key found for this signature in database
GPG Key ID: C837A6716CBE7F49
1 changed files with 1 additions and 1 deletions

View File

@ -135,7 +135,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 %}
$(file > .link_options.txt,$(filter %.o, $^)
+@echo "$(filter %.o, $^)" > .link_options.txt
+@echo "link: $(notdir $@)"
@$(LD) $(LD_FLAGS) {{link_script_option}} $(filter-out %.o, $^) $(LIBRARY_PATHS) --output $@ {{response_option}}.link_options.txt $(LIBRARIES) $(LD_SYS_LIBS)
{% endblock %}