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: refactor the check for missing config files

This commit refactors the check for missing configuration files, making
it easier to add more files to the list.

The format of the error message has been slightly changed, as follows:

[Before]

ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.

[After]

***
*** ERROR: Kernel configuration is invalid. The following files are missing:
*** - include/generated/autoconf.h
*** - include/config/auto.conf
*** Run "make oldconfig && make prepare" on kernel source to fix it.
***

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <n.schier@avm.de>
Tested-by: Miguel Ojeda <ojeda@kernel.org>

+13 -8
+13 -8
Makefile
··· 781 781 else # !may-sync-config 782 782 # External modules and some install targets need include/generated/autoconf.h 783 783 # and include/config/auto.conf but do not care if they are up-to-date. 784 - # Use auto.conf to trigger the test 784 + # Use auto.conf to show the error message 785 + 786 + checked-configs := include/generated/autoconf.h include/config/auto.conf 787 + missing-configs := $(filter-out $(wildcard $(checked-configs)), $(checked-configs)) 788 + 789 + ifdef missing-configs 785 790 PHONY += include/config/auto.conf 786 791 787 792 include/config/auto.conf: 788 - @test -e include/generated/autoconf.h -a -e $@ || ( \ 789 - echo >&2; \ 790 - echo >&2 " ERROR: Kernel configuration is invalid."; \ 791 - echo >&2 " include/generated/autoconf.h or $@ are missing.";\ 792 - echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ 793 - echo >&2 ; \ 794 - /bin/false) 793 + @echo >&2 '***' 794 + @echo >&2 '*** ERROR: Kernel configuration is invalid. The following files are missing:' 795 + @printf >&2 '*** - %s\n' $(missing-configs) 796 + @echo >&2 '*** Run "make oldconfig && make prepare" on kernel source to fix it.' 797 + @echo >&2 '***' 798 + @/bin/false 799 + endif 795 800 796 801 endif # may-sync-config 797 802 endif # need-config