History

kbuild: suppress annoying "... is up to date." message

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.

Masahiro Yamada committed 10 years ago

Commit 2aedcd01 parent 46fe94a1 file · +3 −3Browse files

Unified · Split

scripts/Kbuild.include+3−3
@@ -251,7 +251,7 @@ any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^) · 250 unmodified lines
251251 if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
252252 @set -e; \
253253 $(echo-cmd) $(cmd_$(1)); \
254− printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
254+ printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)
255255
256256 # Execute the command and also postprocess generated .d dependencies file.
257257 if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \
@@ -259,14 +259,14 @@ if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \ · 1 unmodified line
259259 $(echo-cmd) $(cmd_$(1)); \
260260 scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\
261261 rm -f $(depfile); \
262− mv -f $(dot-target).tmp $(dot-target).cmd)
262+ mv -f $(dot-target).tmp $(dot-target).cmd, @:)
263263
264264 # Usage: $(call if_changed_rule,foo)
265265 # Will check if $(cmd_foo) or any of the prerequisites changed,
266266 # and if so will execute $(rule_foo).
267267 if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \
268268 @set -e; \
269− $(rule_$(1)))
269+ $(rule_$(1)), @:)
270270
271271 ###
272272 # why - tell why a a target got build