tools build: fix # escaping in .cmd files for future Make
authorPaul Menzel <pmenzel@molgen.mpg.de>
Tue, 5 Jun 2018 17:00:22 +0000 (19:00 +0200)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 12 Jul 2018 15:48:17 +0000 (00:48 +0900)
commit9feeb638cde083c737e295c0547f1b4f28e99583
tree9a0ee9f2aab30adc365faf46587739ae24314f6a
parent47a18a2dabba99c749b88867a9eef7ca48058e92
tools build: fix # escaping in .cmd files for future Make

In 2016 GNU Make made a backwards incompatible change to the way '#'
characters were handled in Makefiles when used inside functions or
macros:

http://git.savannah.gnu.org/cgit/make.git/commit/?id=c6966b323811c37acedff05b57

Due to this change, when attempting to run `make prepare' I get a
spurious make syntax error:

    /home/earnest/linux/tools/objtool/.fixdep.o.cmd:1: *** missing separator.  Stop.

When inspecting `.fixdep.o.cmd' it includes two lines which use
unescaped comment characters at the top:

    \# cannot find fixdep (/home/earnest/linux/tools/objtool//fixdep)
    \# using basic dep data

This is because `tools/build/Build.include' prints these '\#'
characters:

    printf '\# cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \
    printf '\# using basic dep data\n\n' >> $(dot-target).cmd;           \

This completes commit 9564a8cf422d ("Kbuild: fix # escaping in .cmd files
for future Make").

Link: https://bugzilla.kernel.org/show_bug.cgi?id=197847
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: stable@vger.kernel.org
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
tools/build/Build.include