Skip to content

Makefile: render compatible with some GNU make versions (revert #12646) #12666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2020
Merged

Makefile: render compatible with some GNU make versions (revert #12646) #12666

merged 1 commit into from
Mar 23, 2020

Conversation

dhebbeker
Copy link
Contributor

@dhebbeker dhebbeker commented Mar 21, 2020

Summary of changes

Revert "Fixed problem with overlong command line."

This reverts commit dd02ac0.

This change is needed because it introduced two errors, reported by @vmedcy in #12646 (comment)

Impact of changes

Migration actions required

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Tested with

  • (unmodified) mbed 1.10.2.
  • GNU Make 4.2.1 Built for x86_64-pc-linux-gnu

Test unimpeded Makefile

Tests Makefile which are produced by official release (do not include the erroneous changes).

mbed import mbed-os-example-blinky
cd mbed-os-example-blinky/
mbed export -m K64F -i eclipse_gcc_arm
make

===== bin file ready to flash: BUILD/mbed-os-example-blinky.bin =====

✔️

Test bad version

Tests Makefile which would be produced by dd02ac0.

mbed import mbed-os-example-blinky
cd mbed-os-example-blinky/
mbed export -m K64F -i eclipse_gcc_arm

Apply patch to Makefile:

-	+@echo "$(filter %.o, $^)" > .link_options.txt
+	$(file > .link_options.txt,$(filter %.o, $^)

And then

make
mbed-os-example-blinky/Makefile:1823: *** unterminated call to function 'file': missing ')'.  Stop.
make: *** [Makefile:26: all] Error 2

Test version incompatible to GNU make 3.8.1

Tests Makefile based on dd02ac0 with corrected missing brace.

mbed import mbed-os-example-blinky
cd mbed-os-example-blinky/
mbed export -m K64F -i eclipse_gcc_arm

Apply patch to Makefile:

-	+@echo "$(filter %.o, $^)" > .link_options.txt
+	$(file > .link_options.txt,$(filter %.o, $^))

And then

make

===== bin file ready to flash: BUILD/mbed-os-example-blinky.bin =====

✔️ (with GNU make 4.2.1)


Reviewers


$(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 6918e6a)

Revert "Fixed problem with overlong command line."

This reverts commit dd02ac0.

See also #12646 (comment)
@ciarmcom ciarmcom requested a review from vmedcy March 21, 2020 20:00
@ciarmcom
Copy link
Member

@dhebbeker, thank you for your changes.
@vmedcy @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

@ciarmcom ciarmcom requested review from a team March 21, 2020 20:00
@dhebbeker dhebbeker changed the title Makefile: make compatible with GNU make 3.8.1 (revert #12646) Makefile: render compatible with some GNU make versions (revert #12646) Mar 23, 2020
@dhebbeker
Copy link
Contributor Author

The linking recipe in the version a8a21d3 using $(file > $@.in, $(filter %.o, $^)):

  • works with GNU Make 4.2.1 Built for x86_64-pc-linux-gnu ✔️
  • works with GNU Make 4.3 Built for Windows32 (mingw32-make) even with long object file lists ✔️
  • does not work with with GNU Make 3.81 ❌ (did not test it myself)

The linking recipe in the version 26043e5 using +@echo "$(filter %.o, $^)" > .link_options.txt:

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 23, 2020

CI started

@mergify mergify bot added needs: CI and removed needs: review labels Mar 23, 2020
@mbed-ci
Copy link

mbed-ci commented Mar 23, 2020

Test run: SUCCESS

Summary: 7 of 7 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit 539cf3f into ARMmbed:master Mar 23, 2020
@mergify mergify bot removed the ready for merge label Mar 23, 2020
@dhebbeker dhebbeker deleted the fix/revert-pull-12646 branch April 4, 2020 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants