This is a retake on https://github.com/openjdk/jdk/pull/12461. Changes compared to the original patch:
Both WriteFile and AppendFile are fixed. It turned out we actually did a `$(strip)` on the input for the `$(file)` variant, so for consistency we should do that for the make 3.81 as well. Almost as a side-effect, this will also handle the problem of risking to add multiple newlines, since any trailing newlines will be removed by the strip, and then we can always append a newline. Unit tests are added. I have verified functionality on make 3.81, 4.0 and 4.4. ------------- Commit messages: - 8301753: AppendFile/WriteFile has differences between make 3.81 and 4+ Changes: https://git.openjdk.org/jdk/pull/12605/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12605&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8301753 Stats: 58 lines in 2 files changed: 56 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/12605.diff Fetch: git fetch https://git.openjdk.org/jdk pull/12605/head:pull/12605 PR: https://git.openjdk.org/jdk/pull/12605