summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-04-28 10:41:52 +0200
committerAkim Demaille <akim.demaille@gmail.com>2019-04-28 11:39:10 +0200
commitf92f2f8afe0546fcc80cafa273c243292d98d3b5 (patch)
treee2f6ecb73b191fc440d55980c8adcd26513cf70f /Makefile.am
parent0cc04eaa2a4d5145bb0e2d48b116e2093d12abb8 (diff)
downloadbison-f92f2f8afe0546fcc80cafa273c243292d98d3b5.tar.gz
package: don't regen the parser during dist if unneeded
* Makefile.am (gen-synclines): New.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am16
1 files changed, 14 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 3c4c8765..f6350ac2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -88,9 +88,21 @@ clean-local:
BUILT_SOURCES += $(top_srcdir)/.version
$(top_srcdir)/.version: configure
echo $(VERSION) > $@-t && mv $@-t $@
-dist-hook: gen-ChangeLog
+dist-hook: gen-ChangeLog gen-synclines
echo $(VERSION) > $(distdir)/.tarball-version
- cd $(distdir) && $(abs_top_builddir)/tests/bison $(AM_YFLAGS_WITH_LINES) src/parse-gram.y -o src/parse-gram.c
+
+# When generating a release, include the #lines in Bison's parser. Do it
+# only if needed. In particular, distcheck runs dist with read-only
+# sources, so don't try to update src/parse-gram.c: we don't have the
+# permissions.
+.PHONY: gen-synclines
+gen-synclines:
+ cd $(distdir) && \
+ if ! grep '#line' src/parse-gram.c >/dev/null 2>&1; then \
+ $(abs_top_builddir)/tests/bison \
+ $(AM_YFLAGS_WITH_LINES) src/parse-gram.y \
+ -o src/parse-gram.c; \
+ fi
.PHONY: update-b4-copyright update-package-copyright-year
update-b4-copyright: