From: Chuan-kai Lin <cklin@debian.org>
Date: Mon, 17 Jun 2019 11:21:43 -0700
Subject: Documentation Makefile

Last-Update: 2019-06-17
---
 Makefile | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Makefile

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9ef71c2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+BISON_TEXI = doc/bison.texi
+DESTDIR = $(CURDIR)/debian/tmp
+
+TEXI2PDF = /usr/bin/texi2pdf
+INSTALL = /usr/bin/install
+CP = /bin/cp
+SED = /bin/sed
+
+EXAMPLES = examples/c++/calc++/calc++.cc \
+           examples/c++/calc++/driver.cc \
+           examples/c++/calc++/driver.hh \
+           examples/c++/calc++/parser.yy \
+           examples/c++/calc++/scanner.ll \
+           examples/c++/simple.yy \
+           examples/c/mfcalc/calc.h \
+           examples/c/mfcalc/mfcalc.y \
+           examples/c/rpcalc/rpcalc.y
+
+all: doc/bison.texi
+	$(MAKEINFO) --no-split $^
+	$(SED) -i -e 's/image src="figs/image src="\/usr\/share\/doc\/bison-doc\/html\/figs/' bison.info
+	$(MAKEINFO) -o html --html $^
+	$(TEXI2PDF) $^
+	examples/extexi $^ -- $(EXAMPLES)
+
+install:
+	$(INSTALL) -d $(DESTDIR)/usr/share/info
+	$(CP) bison.info $(DESTDIR)/usr/share/info
+	$(INSTALL) -d $(DESTDIR)/usr/share/doc/bison-doc
+	$(CP) --parents $(EXAMPLES) $(DESTDIR)/usr/share/doc/bison-doc
+	$(CP) -r bison.pdf html $(DESTDIR)/usr/share/doc/bison-doc
+	$(INSTALL) -d $(DESTDIR)/usr/share/doc/bison-doc/html/figs
+	$(CP) -r doc/figs/*.svg $(DESTDIR)/usr/share/doc/bison-doc/html/figs
+
