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 <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57509
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Patrick Georgi 2021-09-09 00:44:06 +02:00
parent a96482acd3
commit 116b144930
1 changed files with 2 additions and 4 deletions

View File

@ -60,10 +60,8 @@ endef
$(foreach prog,$(hostprogs),$(eval $(call hostprogs_template,$(prog)))) $(foreach prog,$(hostprogs),$(eval $(call hostprogs_template,$(prog))))
$(objk)/parser.tab.h: | $(objk)/parser.tab.c $(objk)/%.tab.c $(objk)/%.tab.h: $(srck)/%.y
$(objk)/%.tab.h: | $(objk)/%.tab.c bison -t -l --defines -b $(objk)/$* $<
$(objk)/%.tab.c: $(srck)/%.y
bison -t -l --defines=$(objk)/$*.tab.h -b $(objk)/$* $<
$(objk)/%.lex.c: $(srck)/%.l $(objk)/%.lex.c: $(srck)/%.l
flex -L -o$@ $< flex -L -o$@ $<