From 116b1449304d7dd83a480a07ae870a3a4cf6360e Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 9 Sep 2021 00:44:06 +0200 Subject: [PATCH] util/kconfig: Simplify dependencies for parser.tab.* With parser.tab.h depending on parser.tab.c it's possible for make to initiate the creation of parser.tab.c, then try to compile it, even though parser.tab.h is still missing. This isn't normally an issue yet because bison creates them both at a time but with pre-compiled files this will become a problem. Pattern rules support (until recently as a special case that no other type of rule could implement) multiple targets that are actually treated as "one command creates multiple output files" so use that to state the relationship properly. Change-Id: I4aa7eca9d3123808e0665a15a99c04fac7384940 Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/c/coreboot/+/57509 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- util/kconfig/Makefile.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/util/kconfig/Makefile.inc b/util/kconfig/Makefile.inc index c3b764b2b7..9277b516ee 100644 --- a/util/kconfig/Makefile.inc +++ b/util/kconfig/Makefile.inc @@ -60,10 +60,8 @@ endef $(foreach prog,$(hostprogs),$(eval $(call hostprogs_template,$(prog)))) -$(objk)/parser.tab.h: | $(objk)/parser.tab.c -$(objk)/%.tab.h: | $(objk)/%.tab.c -$(objk)/%.tab.c: $(srck)/%.y - bison -t -l --defines=$(objk)/$*.tab.h -b $(objk)/$* $< +$(objk)/%.tab.c $(objk)/%.tab.h: $(srck)/%.y + bison -t -l --defines -b $(objk)/$* $< $(objk)/%.lex.c: $(srck)/%.l flex -L -o$@ $<