From: Chuan-kai Lin <cklin@debian.org>
Date: Tue, 9 Jul 2019 19:46:16 -0700
Subject: Hack explicit dependencies on parse.h

The targets lexcalc-scan.o and reccalc-scan.o need parse.h to build.
Without explicit dependencies, make might attempt to build those targets
before a different rule finishes generating parse.h, leading to FTBFS.
But the Makefile.in generated by automake generates parse.h through a
.y.c suffix rule (without indicating that invoking bison also generates
a .h output), so explicit dependencies on parse.h also do not work.

This patch implements a hack that makes lexcalc-scan.o and
reccalc-scan.o both depend on parse.c. Since parse.c is generated by the
same rule as parse.h, these bogus dependencies ensure that make attempts
to build those .o files only after parse.h becomes available.

Last-Update: 2019-07-09
---
 examples/c/lexcalc/local.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/examples/c/lexcalc/local.mk b/examples/c/lexcalc/local.mk
index 0acd260..beed85a 100644
--- a/examples/c/lexcalc/local.mk
+++ b/examples/c/lexcalc/local.mk
@@ -27,6 +27,8 @@ if FLEX_WORKS
   %C%_lexcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
 endif FLEX_WORKS
 
+%D%/lexcalc$(DASH)scan.o: %D%/parse.c
+
 %D%/parse.c: $(dependencies)
 
 EXTRA_DIST += %D%/lexcalc.test
