f52e02184e9b2c3b2b8ec81bb363c2f4c789218c
[external/ragel.git] / doc / Makefile.in
1 #
2 #   Copyright 2001-2006 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 # Install prefix.
31 PREFIX = @prefix@
32
33 # Rules.
34 all: ragel-guide.pdf ragel.1 rlcodegen.1
35
36 ragel-guide.pdf: $(PDFFIGS) $(INPUT)
37
38 %.pdf: %.fig
39         fig2dev -L pdf $< $@
40
41 %.pdf: %.tex
42         pdflatex -interaction=nonstopmode $< >/dev/null
43         pdflatex -interaction=nonstopmode $< >/dev/null
44         pdflatex -interaction=nonstopmode $< >/dev/null
45
46 version.tex: ../version.mk
47         echo '\def\version{$(VERSION)}' > version.tex
48         echo '\def\pubdate{$(PUBDATE)}' >> version.tex
49
50 ragel.1: ragel.1.in ../version.mk
51         cat ragel.1.in | sed 's/@PUBDATE@/$(PUBDATE)/' \
52                 | sed 's/@VERSION@/$(VERSION)/' > ragel.1
53
54 rlcodegen.1: rlcodegen.1.in ../version.mk
55         cat rlcodegen.1.in | sed 's/@PUBDATE@/$(PUBDATE)/' \
56                 | sed 's/@VERSION@/$(VERSION)/' > rlcodegen.1
57
58 clean:
59         rm -f ragel.1 rlcodegen.1 \
60                 *.bak *.aux *.dvi *.log *.toc *.pdf
61
62 distclean: clean
63         rm -f Makefile
64         
65 install: all
66         install -d $(PREFIX)/man/man1
67         install -m 644 ragel.1 $(PREFIX)/man/man1/ragel.1
68         install -m 644 rlcodegen.1 $(PREFIX)/man/man1/rlcodegen.1
69         install -d $(PREFIX)/share/doc/ragel
70         install -m 644 ragel-guide.pdf $(PREFIX)/share/doc/ragel/ragel-guide.pdf
71         gzip -c ../ChangeLog > ChangeLog.gz
72         install -m 644 ChangeLog.gz $(PREFIX)/share/doc/ragel/ChangeLog.gz
73         rm ChangeLog.gz