BaseTools/Source/C/VfrCompile: Fix parallel make failures

Update makefile rules to run antlr and dlg to completion
before compiling any of the generated cpp files.

Without this change, parallel make may start compiling some
of the cpp files before both antlr and dlg have finished
which produces syntax errors from compilation with partially
generated files.

Also use &: so the targets are treated as a group and the
rule is only executed once for the entire group. Without
this change, parallel make may run the rule actions more
than once and modify the output while it is being used by
another rule.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
Michael D Kinney 2026-02-24 21:50:20 -08:00 committed by mergify[bot]
parent 4d0946c082
commit 9fc0aca51e

View file

@ -54,10 +54,11 @@ VfrCompiler.o: ../Include/Common/BuildVersion.h
include $(MAKEROOT)/Makefiles/footer.makefile
VfrSyntax.cpp EfiVfrParser.cpp EfiVfrParser.h VfrParser.dlg VfrTokens.h: Pccts/antlr/antlr VfrSyntax.g
Pccts/antlr/antlr -CC -e3 -ck 3 -k 2 -fl VfrParser.dlg -ft VfrTokens.h -o . VfrSyntax.g
ANTLR_GEN = VfrSyntax.cpp EfiVfrParser.cpp EfiVfrParser.h VfrParser.dlg VfrTokens.h
DLG_GEN = VfrLexer.cpp VfrLexer.h
VfrLexer.cpp VfrLexer.h: Pccts/dlg/dlg VfrParser.dlg
$(ANTLR_GEN) $(DLG_GEN) &: Pccts/antlr/antlr Pccts/dlg/dlg VfrSyntax.g
Pccts/antlr/antlr -CC -e3 -ck 3 -k 2 -fl VfrParser.dlg -ft VfrTokens.h -o . VfrSyntax.g
Pccts/dlg/dlg -C2 -i -CC -cl VfrLexer -o . VfrParser.dlg
Pccts/antlr/antlr: