Skip to contentSkip to conversation

Two fixes to make rules

PATCH Applied Daniel P. Berrange 5 participants 10 messages Jan 23, 2018 – Feb 7, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

cover Two fixes to make rules

The primary goal of this was to fix the recent regression that made everything done by make completely silent, causing things like "make install" to emit no output. In doing so I noticed a small mistake in the help text.

Daniel P. Berrange (2):
Revert "build-sys: silence make by default or V=0"
make: fix help message reference to bogus V=0 variable

 Makefile  | 5 +++--
 rules.mak | 2 --
 2 files changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/2 Revert "build-sys: silence make by default or V=0"

This reverts commit 42a77f1ce4934b243df003f95bda88530631387a.

The primary intention of this change was to silence messages like

make[1]: '/home/berrange/src/virt/qemu/capstone/libcapstone.a' is up to date.

which we get when calling make recursively with explicit targets.

The problem is that this change affected every make target, not merely the targets that triggered these "is up to date" messages. As a result any targets that were not invoking commands via "$(call quiet-command ...)" suddenly become silent. This is particularly bad for "make install" which now appears todo nothing.

Rather than go through every make rule and try to identify places where we now need to explicitly print a message to show work taking place, just revert the change.

To address the original problem of silencing "is up to date" messages, we simply add --quiet to the SUBDIR_MAKEVARS variable, so it only affects us on recursive make calls.

---
 Makefile  | 2 +-
 rules.mak | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
Makefile +1 -1
index f26ef1b1df..c263190b8d 100644
@@ -280,7 +280,7 @@ else
 DOCS=
 endif
 
-SUBDIR_MAKEFLAGS=BUILD_DIR=$(BUILD_DIR)
+SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR)
 SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
 SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
 
rules.mak +0 -2
index 5fb4951561..6e943335f3 100644
@@ -131,8 +131,6 @@ modules:
 # If called with only a single argument, will print nothing in quiet mode.
 quiet-command = $(if $(V),$1,$(if $(2),@printf "  %-7s %s\n" $2 $3 && $1, @$1))
 
-MAKEFLAGS += $(if $(V),,--no-print-directory --quiet)
-
 # cc-option
 # Usage: CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
 
Signature · 1 line
2.14.3
Reviewed-by Marc-André Lureau on v1 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH v1 1/2] Revert "build-sys: silence make by default or V=0"

Quoted 21 lines · Daniel P. Berrange

This reverts commit 42a77f1ce4934b243df003f95bda88530631387a.

The primary intention of this change was to silence messages like

make[1]: '/home/berrange/src/virt/qemu/capstone/libcapstone.a' is up to date.

which we get when calling make recursively with explicit targets.

The problem is that this change affected every make target, not merely the targets that triggered these "is up to date" messages. As a result any targets that were not invoking commands via "$(call quiet-command ...)" suddenly become silent. This is particularly bad for "make install" which now appears todo nothing.

Rather than go through every make rule and try to identify places where we now need to explicitly print a message to show work taking place, just revert the change.

Quoted 5 lines

To address the original problem of silencing "is up to date" messages, we simply add --quiet to the SUBDIR_MAKEVARS variable, so it only affects us on recursive make calls.

Quoted 34 lines
---
 Makefile  | 2 +-
 rules.mak | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
Makefile +1 -1
index f26ef1b1df..c263190b8d 100644
@@ -280,7 +280,7 @@ else
 DOCS=
 endif
 
-SUBDIR_MAKEFLAGS=BUILD_DIR=$(BUILD_DIR)
+SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR)
 SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
 SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
 
rules.mak +0 -3
index 5fb4951561..6e943335f3 100644
@@ -131,8 +131,6 @@ modules:
 # If called with only a single argument, will print nothing in quiet mode.
 quiet-command = $(if $(V),$1,$(if $(2),@printf "  %-7s %s\n" $2 $3 && $1, @$1))
 
-MAKEFLAGS += $(if $(V),,--no-print-directory --quiet)
-
 # cc-option
 # Usage: CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
 
--

2.14.3

#3 lore raw

Re: [Qemu-devel] [PATCH v1 1/2] Revert "build-sys: silence make by default or V=0"

In reply to Daniel P. Berrange
Quoted 17 lines · Daniel P. Berrange

This reverts commit 42a77f1ce4934b243df003f95bda88530631387a.

The primary intention of this change was to silence messages like

make[1]: '/home/berrange/src/virt/qemu/capstone/libcapstone.a' is up to date.

which we get when calling make recursively with explicit targets.

The problem is that this change affected every make target, not merely the targets that triggered these "is up to date" messages. As a result any targets that were not invoking commands via "$(call quiet-command ...)" suddenly become silent. This is particularly bad for "make install" which now appears todo nothing.

Quoted 7 lines

Rather than go through every make rule and try to identify places where we now need to explicitly print a message to show work taking place, just revert the change.

To address the original problem of silencing "is up to date" messages, we simply add --quiet to the SUBDIR_MAKEVARS variable, so it only affects us on recursive make calls.

s/SUBDIR_MAKEVARS/SUBDIR_MAKEFLAGS/?

Quoted 24 lines
---
  Makefile  | 2 +-
  rules.mak | 2 --
  2 files changed, 1 insertion(+), 3 deletions(-)
Makefile +1 -1
index f26ef1b1df..c263190b8d 100644
@@ -280,7 +280,7 @@ else
  DOCS=
  endif
 
-SUBDIR_MAKEFLAGS=BUILD_DIR=$(BUILD_DIR)
+SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR)
  SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
  SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
 
rules.mak +0 -0
index 5fb4951561..6e943335f3 100644

rules.mak modules: · line 135

Quoted 7 lines
rules.mak +0 -2
@@ -131,8 +131,6 @@ modules:
  # If called with only a single argument, will print nothing in quiet mode.
  quiet-command = $(if $(V),$1,$(if $(2),@printf "  %-7s %s\n" $2 $3 && $1, @$1))
 
-MAKEFLAGS += $(if $(V),,--no-print-directory --quiet)
-
  # cc-option
  # Usage: CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)

Thanks for spending the time debugging this, Dan.

ATB,

Mark.

Tested-by on v1 1/2
#4 lore raw

Re: [Qemu-devel] [PATCH v1 1/2] Revert "build-sys: silence make by default or V=0"

In reply to Daniel P. Berrange
Quoted 17 lines · Daniel P. Berrange

This reverts commit 42a77f1ce4934b243df003f95bda88530631387a.

The primary intention of this change was to silence messages like

make[1]: '/home/berrange/src/virt/qemu/capstone/libcapstone.a' is up to date.

which we get when calling make recursively with explicit targets.

The problem is that this change affected every make target, not merely the targets that triggered these "is up to date" messages. As a result any targets that were not invoking commands via "$(call quiet-command ...)" suddenly become silent. This is particularly bad for "make install" which now appears todo nothing.

Quoted 7 lines

Rather than go through every make rule and try to identify places where we now need to explicitly print a message to show work taking place, just revert the change.

To address the original problem of silencing "is up to date" messages, we simply add --quiet to the SUBDIR_MAKEVARS variable, so it only affects us on recursive make calls.

As for solving the original intended issue, this patch silences the message about libcapstone, and reverting back to a known state is more conservative, so I'm okay with this going in.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#5 lore raw

PATCH 2/2 make: fix help message reference to bogus V=0 variable

In reply to Daniel P. Berrange

The make rules for building QEMU are mostly silent by default. They can be made verbose by setting the variable V=1. The default state does not however correspond to a V=0 setting - $(V) must be undefined / empty to get the default quiet build.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index c263190b8d..554ba69ced 100644
@@ -940,4 +940,5 @@ ifdef QEMU_GA_MSI_ENABLED
 endif
 	@echo  ''
 endif
-	@echo  '  $(MAKE) V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
+	@echo  '  $(MAKE) [targets]      (quiet build, default)'
+	@echo  '  $(MAKE) V=1 [targets]  (verbose build)'
Signature · 1 line
2.14.3
Reviewed-by Marc-André Lureau on v1 2/2
#6 lore raw

Re: [Qemu-devel] [PATCH v1 2/2] make: fix help message reference to bogus V=0 variable

Quoted 6 lines · Daniel P. Berrange

The make rules for building QEMU are mostly silent by default. They can be made verbose by setting the variable V=1. The default state does not however correspond to a V=0 setting - $(V) must be undefined / empty to get the default quiet build.

(with that, qemu build-sys differs from automake & kernel at least)

Quoted 18 lines
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -2
index c263190b8d..554ba69ced 100644
@@ -940,4 +940,5 @@ ifdef QEMU_GA_MSI_ENABLED
 endif
        @echo  ''
 endif
-       @echo  '  $(MAKE) V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
+       @echo  '  $(MAKE) [targets]      (quiet build, default)'
+       @echo  '  $(MAKE) V=1 [targets]  (verbose build)'
--

2.14.3

#7 lore raw

Re: [Qemu-devel] [PATCH v1 2/2] make: fix help message reference to bogus V=0 variable

In reply to Daniel P. Berrange
Quoted 4 lines · Daniel P. Berrange

The make rules for building QEMU are mostly silent by default. They can be made verbose by setting the variable V=1. The default state does not however correspond to a V=0 setting - $(V) must be undefined / empty to get the default quiet build.

Makefiles generated by automake support V=0; how hard would it be to instead tweak things so that 'V=' and 'V=0' have the same effect?

Quoted 18 lines
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index c263190b8d..554ba69ced 100644
@@ -940,4 +940,5 @@ ifdef QEMU_GA_MSI_ENABLED
 endif
 	@echo  ''
 endif
-	@echo  '  $(MAKE) V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
+	@echo  '  $(MAKE) [targets]      (quiet build, default)'
+	@echo  '  $(MAKE) V=1 [targets]  (verbose build)'
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#8 lore raw

Re: [Qemu-devel] [PATCH v1 2/2] make: fix help message reference to bogus V=0 variable

Quoted 8 lines · Eric Blake
Quoted 4 lines · Daniel P. Berrange

The make rules for building QEMU are mostly silent by default. They can be made verbose by setting the variable V=1. The default state does not however correspond to a V=0 setting - $(V) must be undefined / empty to get the default quiet build.

Makefiles generated by automake support V=0; how hard would it be to instead tweak things so that 'V=' and 'V=0' have the same effect?

Well it would make the various conmditionals a bit more complex because we'd have to check three states instead of two. I'm not really convinced it is worth it because explicitly passing V=0 doesn't do anything useful given that we are unconditionally silent by default.

It makes more sense with autoconf, because the default behaviour may vary based on configure setup and/or configure args, so you can't assume that omitting 'V=' gives you silent build like we do with QEMU.

Quoted 7 lines
Quoted 7 lines
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 18 lines
Quoted 12 lines
Makefile +2 -1
index c263190b8d..554ba69ced 100644
@@ -940,4 +940,5 @@ ifdef QEMU_GA_MSI_ENABLED
 endif
 	@echo  ''
 endif
-	@echo  '  $(MAKE) V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
+	@echo  '  $(MAKE) [targets]      (quiet build, default)'
+	@echo  '  $(MAKE) V=1 [targets]  (verbose build)'
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#9 lore raw
In reply to Daniel P. Berrange
Quoted 5 lines · Daniel P. Berrange

The primary goal of this was to fix the recent regression that made everything done by make completely silent, causing things like "make install" to emit no output. In doing so I noticed a small mistake in the help text.

Quoted 8 lines

Daniel P. Berrange (2):
Revert "build-sys: silence make by default or V=0"
make: fix help message reference to bogus V=0 variable

 Makefile  | 5 +++--
 rules.mak | 2 --
 2 files changed, 3 insertions(+), 4 deletions(-)

Queued, thanks.

Paolo