summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-14 06:27:33 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-14 06:27:33 -0700
commitfdb54c85577859e26525463c2e21801cd9b2377c (patch)
tree9f219b7f56e613f48d56f3c45f28a23584fb1d60 /Makefile
parent9952353de4a6bdfd27727a00d53ae8958038c72d (diff)
downloadtxr-fdb54c85577859e26525463c2e21801cd9b2377c.tar.gz
txr-fdb54c85577859e26525463c2e21801cd9b2377c.tar.bz2
txr-fdb54c85577859e26525463c2e21801cd9b2377c.zip
Remove unwanted yyparse declaration from y.tab.h.
* Makefile (y.tab.c): Putting in an ugly workaround for an obnoxious new behavior introduced in Bison 3.x, which breaks our build on platforms that have a newer Bison. After generating y.tab.h, we remove the unwanted declaration with sed. * parser.y (yyparse): Declare, since y.tab.h doesn't any more, and the newer Bison's parse skeletons expect it.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index ef4591c4..30f09166 100644
--- a/Makefile
+++ b/Makefile
@@ -203,7 +203,14 @@ y.tab.h: y.tab.c
y.tab.c: $(top_srcdir)parser.y
$(call ABBREV,YACC)
$(V)rm -f y.tab.c
- $(V)if $(YACC) -v -d $< ; then chmod a-w y.tab.c ; true ; else rm y.tab.c ; false ; fi
+ $(V)if $(YACC) -v -d $< ; then \
+ chmod a-w y.tab.c ; \
+ sed -e '/yyparse/d' < y.tab.h > y.tab.h.tmp && \
+ mv y.tab.h.tmp y.tab.h ; \
+ else \
+ rm y.tab.c ; \
+ false ; \
+ fi
# Suppress useless sccs id array and unused label warning in byacc otuput.
# Bison-generated parser also tests for this lint define.