If you run "make menuconfig" or "make nconfig" with -j<N> option in a
fresh source tree, you will see several "Can't open ..." messages:
$ make -j8 menuconfig
HOSTCC scripts/basic/fixdep
YACC scripts/kconfig/zconf.tab.c
LEX scripts/kconfig/zconf.lex.c
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: HOSTCC scripts/kconfig/lxdialog/checklist.o
Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
HOSTCC scripts/kconfig/lxdialog/inputbox.o
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
UPD scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/mconf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/mconf
Correct dependencies to fix this problem.
Fixes: 1c5af5cf9308 ("kconfig: refactor ncurses package checks for building mconf and nconf")
Cc: linux-stable <stable@vger.kernel.org> # v4.18
Reported-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Borislav Petkov <bp@suse.de>
HOSTCFLAGS_nconf.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags)
HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags)
-$(obj)/nconf.o: $(obj)/.nconf-cfg
+$(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/.nconf-cfg
# mconf: Used for the menuconfig target based on lxdialog
hostprogs-y += mconf
$(foreach f, mconf.o $(lxdialog), \
$(eval HOSTCFLAGS_$f = $$(shell . $(obj)/.mconf-cfg && echo $$$$cflags)))
-$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/.mconf-cfg
+$(obj)/mconf.o: $(obj)/.mconf-cfg
+$(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/.mconf-cfg
# qconf: Used for the xconfig target based on Qt
hostprogs-y += qconf