Applied a patch from Andrei Polushin for setting the error message format.
[external/ragel.git] / doc / Makefile.in
1 #
2 #   Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
3 #
4
5 #   This file is part of Ragel.
6 #
7 #   Ragel is free software; you can redistribute it and/or modify
8 #   it under the terms of the GNU General Public License as published by
9 #   the Free Software Foundation; either version 2 of the License, or
10 #   (at your option) any later version.
11 #
12 #   Ragel is distributed in the hope that it will be useful,
13 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #   GNU General Public License for more details.
16 #
17 #   You should have received a copy of the GNU General Public License
18 #   along with Ragel; if not, write to the Free Software
19 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
20
21 INPUT = version.tex ragel-guide.tex
22
23 # Pick up all the figures in the current dir.
24 FIGURES = $(wildcard *.fig)
25 PDFFIGS = $(FIGURES:%.fig=%.pdf)
26
27 # Get the version info.
28 include ../version.mk
29
30 # Installation locations.
31 PACKAGE     = ragel
32 prefix      = @prefix@
33 datarootdir = @datarootdir@
34 docdir      = @docdir@
35 mandir      = @mandir@
36
37 MANPAGES = ragel.1 rlgen-cd.1 rlgen-java.1 rlgen-ruby.1 rlgen-dot.1
38
39 # Rules.
40 all: ragel-guide.pdf $(MANPAGES)
41
42 ragel-guide.pdf: $(PDFFIGS) $(INPUT)
43
44 %.pdf: %.fig
45         fig2dev -L pdf $< $@
46
47 %.pdf: %.tex
48         pdflatex -interaction=nonstopmode $< >/dev/null
49         pdflatex -interaction=nonstopmode $< >/dev/null
50         pdflatex -interaction=nonstopmode $< >/dev/null
51
52 version.tex: ../version.mk
53         echo '|def|version{$(VERSION)}' | tr '|' '\\' > version.tex
54         echo '|def|pubdate{$(PUBDATE)}' | tr '|' '\\' >> version.tex
55
56 %.1: %.1.in ../version.mk
57         cat $< | sed 's/@PUBDATE@/$(PUBDATE)/' \
58                 | sed 's/@VERSION@/$(VERSION)/' > $@
59
60 clean:
61         rm -f $(MANPAGES) *.bak *.aux *.dvi *.log *.toc *.pdf
62
63 distclean: clean
64         rm -f Makefile
65         
66 install: all
67         install -d $(mandir)/man1
68         install -m 644 ragel.1      $(mandir)/man1/ragel.1
69         install -m 644 rlgen-dot.1  $(mandir)/man1/rlgen-dot.1
70         install -m 644 rlgen-cd.1   $(mandir)/man1/rlgen-cd.1
71         install -m 644 rlgen-java.1 $(mandir)/man1/rlgen-java.1
72         install -m 644 rlgen-ruby.1 $(mandir)/man1/rlgen-ruby.1
73         install -d $(docdir)
74         install -m 644 ragel-guide.pdf $(docdir)/ragel-guide.pdf
75         gzip -c ../ChangeLog > ChangeLog.gz
76         install -m 644 ChangeLog.gz $(docdir)/ChangeLog.gz
77         rm ChangeLog.gz