Subject: [PATCH] Respect warnings added in GNU Make 4.4.90

From: Collin Funk <[email-masked]>
Date: Thu, 08 Feb 2024 19:00:02 -0800

Tags: patch

Tags: patch

When building Emacs with recent versions of GNU Make every object file
built will result in a warning like so:

../src/verbose.mk:58: warning: invalid variable reference ' '
  CC       emacs-module.o

This doesn't prevent Emacs from building but makes it slightly harder
to see any build output. I attached a patch that should work for all
versions of GNU Make, both before and after the change. However it
also causes the indentation to disappear in-front of CC and ELC which
looks a bit strange. It doesn't seem like there is a valid way to do
this at the moment. More discussion about this change can be seen
here: https://savannah.gnu.org/bugs/?65273

Feel free to change my patch if you see a better way to solve these
warnings.

Also, I have never committed to Emacs. This change feels trivial but
results in 34 lines changed. Therefore I was unsure if this patch
could be Copyright-paperwork-exempt tagged. Feel free to email me off
list if I must fill them out. Thanks

Collin

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2024-02-07 built on debian
Repository revision: ed2450e79b597e0306f14b542e934a90dfd9786f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --prefix=/home/collin/.local --with-sound=no
 --with-libsystemd --without-gconf --without-compress-install
 --with-native-compilation=yes --with-cairo --with-x=yes
 --with-x-toolkit=gtk3 --with-harfbuzz --with-tree-sitter --with-json
 --with-imagemagick'

>From dee15de965a10f3cc9816c0e177b9a3208f367a8 Mon Sep 17 00:00:00 2001
From: Collin Funk <[email-masked]>
Date: Thu, 8 Feb 2024 18:19:45 -0800
Subject: [PATCH] Respect warnings added in GNU Make 4.4.90

* src/verbose.mk.in: Get rid of invalid variable references in
the info function. These were used to indent messages in build
output but cause warning spam in GNU Make 4.4.90 and later.
More information about this can be found here:
https://savannah.gnu.org/bugs/?65273
---
 src/verbose.mk.in | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/verbose.mk.in b/src/verbose.mk.in
index e72c182f276..d2c28909436 100644
--- a/src/verbose.mk.in
+++ b/src/verbose.mk.in
@@ -53,38 +53,38 @@ have_working_info = $(filter notintermediate,$(value .FEATURES))
 # The workaround is done only for AM_V_ELC and AM_V_ELN,
 # since the bug is not annoying elsewhere.
 
-AM_V_AR      = @$(info $   AR       $@)
+AM_V_AR      = @$(info AR       $@)
 AM_V_at = @
-AM_V_CC      = @$(info $   CC       $@)
-AM_V_CXX     = @$(info $   CXX      $@)
-AM_V_CCLD    = @$(info $   CCLD     $@)
-AM_V_CXXLD   = @$(info $   CXXLD    $@)
+AM_V_CC      = @$(info CC       $@)
+AM_V_CXX     = @$(info CXX      $@)
+AM_V_CCLD    = @$(info CCLD     $@)
+AM_V_CXXLD   = @$(info CXXLD    $@)
 
 ifeq ($(HAVE_NATIVE_COMP)-$(NATIVE_DISABLED)-$(ANCIENT),yes--)
 ifneq (,$(have_working_info))
-AM_V_ELC     = @$(info $   ELC+ELN  $@)
-AM_V_ELN     = @$(info $   ELN      $@)
+AM_V_ELC     = @$(info ELC+ELN  $@)
+AM_V_ELN     = @$(info ELN      $@)
 else
-AM_V_ELC     = @echo "  ELC+ELN " $@;
-AM_V_ELN     = @echo "  ELN     " $@;
+AM_V_ELC     = @echo "ELC+ELN " $@;
+AM_V_ELN     = @echo "ELN     " $@;
 endif
 else
 ifneq (,$(have_working_info))
-AM_V_ELC     = @$(info $   ELC      $@)
+AM_V_ELC     = @$(info ELC      $@)
 else
-AM_V_ELC     = @echo "  ELC     " $@;
+AM_V_ELC     = @echo "ELC     " $@;
 endif
 AM_V_ELN =
 endif
 
-AM_V_GEN     = @$(info $   GEN      $@)
-AM_V_GLOBALS = @$(info $   GEN      globals.h)
+AM_V_GEN     = @$(info GEN      $@)
+AM_V_GLOBALS = @$(info GEN      globals.h)
 AM_V_NO_PD = --no-print-directory
-AM_V_RC      = @$(info $   RC       $@)
+AM_V_RC      = @$(info RC       $@)
 
 # These are used for the Android port.
-AM_V_JAVAC	= @$(info $   JAVAC    $@)
-AM_V_D8		= @$(info $   D8       $@)
-AM_V_AAPT	= @$(info $   AAPT     $@)
+AM_V_JAVAC	= @$(info JAVAC    $@)
+AM_V_D8		= @$(info D8       $@)
+AM_V_AAPT	= @$(info AAPT     $@)
 AM_V_SILENT	= @
 endif
-- 
2.39.2