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.

Also, change the linker responce file name to .link_options.txt.
This is an internal file, not a build artifact.
pull/9596/head
Volodymyr Medvid 2019-02-04 20:10:39 +02:00
parent a8a21d30a1
commit 6918e6a76b
1 changed files with 2 additions and 2 deletions

View File

@ -135,9 +135,9 @@ $(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 > $@.in, $(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}}$@.in $(LIBRARIES) $(LD_SYS_LIBS)
@$(LD) $(LD_FLAGS) {{link_script_option}} $(filter-out %.o, $^) $(LIBRARY_PATHS) --output $@ {{response_option}}.link_options.txt $(LIBRARIES) $(LD_SYS_LIBS)
{% endblock %}
$(PROJECT).bin: $(PROJECT).elf