Makefile: Fix regression in .SILENT rule

Since commit d74e651b78 (Makefiles: Re-implement makefile target path
escaping and quoting, 2020-04-10, v3.18.0-rc1~334^2~1), `WriteMakeRule`
now correctly escapes `$` in make target paths as `$$`.  However, this
caused an existing call site to escape the `$(VERBOSE)` variable
reference in the `.SILENT` prefix, making it ineffective.  Sub-makefiles
are invoked with `MAKESILENT`, so this bug matters only for the `all`
target, which emits progress messages from toplevel.

Before:

    # Suppress display of executed commands.
    $$(VERBOSE).SILENT:

After:

    # Suppress display of executed commands.
    $(VERBOSE).SILENT:
This commit is contained in:
Daniel Colascione
2020-06-21 17:40:25 -07:00
committed by Brad King
parent e66fe75792
commit 7f78bc42cb

View File

@@ -713,9 +713,10 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsTop(
// "VERBOSE=1" to be added as a make variable which will change the // "VERBOSE=1" to be added as a make variable which will change the
// name of this special target. This gives a make-time choice to // name of this special target. This gives a make-time choice to
// the user. // the user.
this->WriteMakeRule(makefileStream, // Write directly to the stream since WriteMakeRule escapes '$'.
"Suppress display of executed commands.", makefileStream << "#Suppress display of executed commands.\n"
"$(VERBOSE).SILENT", no_depends, no_commands, false); "$(VERBOSE).SILENT:\n"
"\n";
} }
// Work-around for makes that drop rules that have no dependencies // Work-around for makes that drop rules that have no dependencies