Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: reduce output spam when building out of tree

The execution of $(call cmd,makefile) will print 'GEN Makefile' on each
build, even if the Makefile is not effectively changed.

Use a filechk command instead, so a message is only printed on changes.

The Makefile is now created even if the build is aborted due to an
unclean working tree. That should not make a difference in practice.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20260305-kbuild-makefile-spam-v1-1-910f6cf218a1@linutronix.de
Signed-off-by: Nicolas Schier <nsc@kernel.org>

authored by

Thomas Weißschuh and committed by
Nicolas Schier
c9bb03ac dc3b9075

+9 -5
+9 -5
Makefile
··· 675 675 echo "export KBUILD_OUTPUT = $(CURDIR)" 676 676 endif 677 677 678 - quiet_cmd_makefile = GEN Makefile 679 - cmd_makefile = { \ 678 + filechk_makefile = { \ 680 679 echo "\# Automatically generated by $(abs_srctree)/Makefile: don't edit"; \ 681 680 $(print_env_for_makefile); \ 682 681 echo "include $(abs_srctree)/Makefile"; \ 683 - } > Makefile 682 + } 684 683 685 - outputmakefile: 684 + $(objtree)/Makefile: FORCE 685 + $(call filechk,makefile) 686 + 687 + # Prevent $(srcroot)/Makefile from inhibiting the rule to run. 688 + PHONY += $(objtree)/Makefile 689 + 690 + outputmakefile: $(objtree)/Makefile 686 691 ifeq ($(KBUILD_EXTMOD),) 687 692 @if [ -f $(srctree)/.config -o \ 688 693 -d $(srctree)/include/config -o \ ··· 708 703 fi 709 704 endif 710 705 $(Q)ln -fsn $(srcroot) source 711 - $(call cmd,makefile) 712 706 $(Q)test -e .gitignore || \ 713 707 { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore 714 708 endif