mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kbuild: suppress annoying "... is up to date." message
@ 2016-03-03  8:36 Masahiro Yamada
  2016-03-04 22:20 ` Michal Marek
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2016-03-03  8:36 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Masahiro Yamada, David Howells, Michal Marek, David Woodhouse,
	linux-kernel

Under certain conditions, Kbuild shows "... is up to date" where
if_changed or friends are used.

For example, the incremental build of ARM64 Linux shows this message
when the kernel image has not been updated.

  $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
    CHK     include/config/kernel.release
    CHK     include/generated/uapi/linux/version.h
    CHK     include/generated/utsrelease.h
    CHK     include/generated/bounds.h
    CHK     include/generated/timeconst.h
    CHK     include/generated/asm-offsets.h
    CALL    scripts/checksyscalls.sh
    CHK     include/generated/compile.h
    CHK     kernel/config_data.h
  make[1]: `arch/arm64/boot/Image.gz' is up to date.
    Building modules, stage 2.
    MODPOST 0 modules

The following is the build rule in arch/arm64/boot/Makefile:

  $(obj)/Image.gz: $(obj)/Image FORCE
          $(call if_changed,gzip)

If the Image.gz is newer than the Image and the command line has not
changed (i.e., $(any-prereq) and $(arg-check) are both empty), the
build rule $(call if_changed,gzip) is evaluated to be empty, then
GNU Make reports the target is up to date.  In order to make GNU Make
quiet, we need to give it something to do, for example, "@:".  This
should be fixed in the Kbuild core part rather than in each Makefile.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/Kbuild.include | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 1db6d73..b2ab2a9 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -251,7 +251,7 @@ any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
 if_changed = $(if $(strip $(any-prereq) $(arg-check)),                       \
 	@set -e;                                                             \
 	$(echo-cmd) $(cmd_$(1));                                             \
-	printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
+	printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)
 
 # Execute the command and also postprocess generated .d dependencies file.
 if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ),                  \
@@ -259,14 +259,14 @@ if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ),                  \
 	$(echo-cmd) $(cmd_$(1));                                             \
 	scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\
 	rm -f $(depfile);                                                    \
-	mv -f $(dot-target).tmp $(dot-target).cmd)
+	mv -f $(dot-target).tmp $(dot-target).cmd, @:)
 
 # Usage: $(call if_changed_rule,foo)
 # Will check if $(cmd_foo) or any of the prerequisites changed,
 # and if so will execute $(rule_foo).
 if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ),                 \
 	@set -e;                                                             \
-	$(rule_$(1)))
+	$(rule_$(1)), @:)
 
 ###
 # why - tell why a a target got build
-- 
1.9.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: suppress annoying "... is up to date." message
  2016-03-03  8:36 [PATCH] kbuild: suppress annoying "... is up to date." message Masahiro Yamada
@ 2016-03-04 22:20 ` Michal Marek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Marek @ 2016-03-04 22:20 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, David Howells, Michal Marek, David Woodhouse, linux-kernel

On Thu, Mar 03, 2016 at 05:36:30PM +0900, Masahiro Yamada wrote:
> Under certain conditions, Kbuild shows "... is up to date" where
> if_changed or friends are used.
> 
> For example, the incremental build of ARM64 Linux shows this message
> when the kernel image has not been updated.
> 
>   $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
>     CHK     include/config/kernel.release
>     CHK     include/generated/uapi/linux/version.h
>     CHK     include/generated/utsrelease.h
>     CHK     include/generated/bounds.h
>     CHK     include/generated/timeconst.h
>     CHK     include/generated/asm-offsets.h
>     CALL    scripts/checksyscalls.sh
>     CHK     include/generated/compile.h
>     CHK     kernel/config_data.h
>   make[1]: `arch/arm64/boot/Image.gz' is up to date.
>     Building modules, stage 2.
>     MODPOST 0 modules
> 
> The following is the build rule in arch/arm64/boot/Makefile:
> 
>   $(obj)/Image.gz: $(obj)/Image FORCE
>           $(call if_changed,gzip)
> 
> If the Image.gz is newer than the Image and the command line has not
> changed (i.e., $(any-prereq) and $(arg-check) are both empty), the
> build rule $(call if_changed,gzip) is evaluated to be empty, then
> GNU Make reports the target is up to date.  In order to make GNU Make
> quiet, we need to give it something to do, for example, "@:".  This
> should be fixed in the Kbuild core part rather than in each Makefile.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Thanks, applied to kbuild.git#kbuild.

Michal

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-04 22:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-03  8:36 [PATCH] kbuild: suppress annoying "... is up to date." message Masahiro Yamada
2016-03-04 22:20 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®