-SUBDIRS = ragel aapl test
+SUBDIRS = ragel aapl doc test
-no_parsers = 's/build_parsers=yes/build_parsers=no/'
+dist_doc_DATA = ChangeLog
+
+sed_script = 's/build_parsers=yes/build_parsers=no/;s/build_manual=yes/build_manual=no/;'
dist-hook:
cp $(top_distdir)/configure $(top_distdir)/configure.tmp
cp $(top_distdir)/configure.in $(top_distdir)/configure.in.tmp
- sed $(no_parsers) $(top_distdir)/configure.tmp > $(top_distdir)/configure
- sed $(no_parsers) $(top_distdir)/configure.in.tmp > $(top_distdir)/configure.in
+ sed $(sed_script) $(top_distdir)/configure.tmp > $(top_distdir)/configure
+ sed $(sed_script) $(top_distdir)/configure.in.tmp > $(top_distdir)/configure.in
rm $(top_distdir)/configure.tmp $(top_distdir)/configure.in.tmp
build_parsers=yes;
AM_CONDITIONAL(BUILD_PARSERS, [test "x$build_parsers" = "xyes"])
+build_manual=yes;
+AM_CONDITIONAL(BUILD_MANUAL, [test "x$build_manual" = "xyes"])
+
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
dnl write output files
AC_OUTPUT(
- [Makefile ragel/Makefile aapl/Makefile doc/Makefile test/Makefile test/runtests],
+ [
+ Makefile ragel/Makefile aapl/Makefile doc/Makefile test/Makefile test/runtests
+ doc/ragel.1
+ ],
[chmod +x test/runtests]
)
--- /dev/null
+#
+# Copyright 2001-2007 Adrian Thurston <thurston@complang.org>
+#
+
+# This file is part of Ragel.
+#
+# Ragel is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# Ragel is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Ragel; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+man_MANS = ragel.1
+
+dist_doc_DATA = ragel-guide.pdf
+
+if BUILD_MANUAL
+
+.fig.pdf:
+ fig2dev -L pdf $< $@
+
+.tex.pdf:
+ pdflatex -interaction=nonstopmode $< >/dev/null
+ pdflatex -interaction=nonstopmode $< >/dev/null
+ pdflatex -interaction=nonstopmode $< >/dev/null
+
+version.tex: Makefile
+ echo '|def|version{$(PACKAGE_VERSION)}' | tr '|' '\\' > version.tex
+ echo '|def|pubdate{$(PUBDATE)}' | tr '|' '\\' >> version.tex
+
+ragel-guide.pdf: version.tex
+
+ragel-guide.pdf: bmconcat.pdf bmregex.pdf dropdown.pdf exdoneact.pdf \
+ exoutact1.pdf exstrongsubtr.pdf lines2.pdf smallscanner.pdf bmnull.pdf \
+ comments1.pdf entryguard.pdf exinter.pdf exoutact2.pdf exsubtr.pdf \
+ lmkleene.pdf stembed.pdf bmnum.pdf comments2.pdf exaction.pdf \
+ exnegate.pdf explus.pdf finguard.pdf opconcat.pdf bmor.pdf conds1.pdf \
+ exallact.pdf exoption.pdf exstact.pdf leftguard.pdf opor.pdf \
+ bmrange.pdf conds2.pdf exconcat.pdf exor.pdf exstar.pdf lines1.pdf \
+ opstar.pdf
+
+endif
+++ /dev/null
-#
-# Copyright 2001-2007 Adrian Thurston <thurston@complang.org>
-#
-
-# This file is part of Ragel.
-#
-# Ragel is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# Ragel is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ragel; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-INPUT = version.tex ragel-guide.tex
-
-# Pick up all the figures in the current dir.
-FIGURES = $(wildcard *.fig)
-PDFFIGS = $(FIGURES:%.fig=%.pdf)
-
-# Get the version info.
-include ../version.mk
-
-# Installation locations.
-PACKAGE = ragel
-prefix = @prefix@
-datarootdir = @datarootdir@
-docdir = @docdir@
-mandir = @mandir@
-
-MANPAGES = ragel.1
-
-# Rules.
-all: ragel-guide.pdf $(MANPAGES)
-
-ragel-guide.pdf: $(PDFFIGS) $(INPUT)
-
-%.pdf: %.fig
- fig2dev -L pdf $< $@
-
-%.pdf: %.tex
- pdflatex -interaction=nonstopmode $< >/dev/null
- pdflatex -interaction=nonstopmode $< >/dev/null
- pdflatex -interaction=nonstopmode $< >/dev/null
-
-version.tex: ../version.mk
- echo '|def|version{$(VERSION)}' | tr '|' '\\' > version.tex
- echo '|def|pubdate{$(PUBDATE)}' | tr '|' '\\' >> version.tex
-
-%.1: %.1.in ../version.mk
- cat $< | sed 's/@PUBDATE@/$(PUBDATE)/' \
- | sed 's/@VERSION@/$(VERSION)/' > $@
-
-clean:
- rm -f $(MANPAGES) *.bak *.aux *.dvi *.log *.toc *.pdf
-
-distclean: clean
- rm -f Makefile
-
-man: $(MANPAGES)
-
-man-install: man
- install -d $(DESTDIR)$(mandir)/man1
- install -m 644 ragel.1 $(DESTDIR)$(mandir)/man1/ragel.1
-
-install: all man-install
- install -d $(DESTDIR)$(docdir)
- install -m 644 ragel-guide.pdf $(DESTDIR)$(docdir)/ragel-guide.pdf
- gzip -c ../ChangeLog > ChangeLog.gz
- install -m 644 ChangeLog.gz $(DESTDIR)$(docdir)/ChangeLog.gz
- rm ChangeLog.gz