From: Chuan-kai Lin <cklin@debian.org>
Date: Sun, 10 May 2020 21:07:00 -0700
Subject: Hack explicit dependencies on parse.h

The target lexcalc-scan.o needs parse.h to build.  Without explicit
dependencies, make might attempt to build that target 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 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 the .o file only
after parse.h becomes available.
---
 examples/c/lexcalc/local.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/c/lexcalc/local.mk b/examples/c/lexcalc/local.mk
index 636275c..c1bad98 100644
--- a/examples/c/lexcalc/local.mk
+++ b/examples/c/lexcalc/local.mk
@@ -29,6 +29,9 @@ if FLEX_WORKS
   # %C%_lexcalc_CFLAGS = $(TEST_CFLAGS)
 endif FLEX_WORKS
 
+%D%/lexcalc$(DASH)scan.o: %D%/parse.c
+%D%/examples_c_lexcalc_lexcalc$(DASH)scan.o: %D%/parse.c
+
 %D%/parse.c: $(dependencies)
 
 # Tell Make scan.o depends on parse.h, except that Make sees only
