Updates to "machine instantiation", "write init" and "write exports" sectons.
[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 prefix = @prefix@
32 docdir = @datadir@/doc/ragel
33 mandir = @mandir@
34
35
36 MANPAGES = ragel.1 rlgen-cd.1 rlgen-java.1 rlgen-ruby.1 rlgen-dot.1
37
38 # Rules.
39 all: ragel-guide.pdf $(MANPAGES)
40
41 ragel-guide.pdf: $(PDFFIGS) $(INPUT)
42
43 %.pdf: %.fig
44         fig2dev -L pdf $< $@
45
46 %.pdf: %.tex
47         pdflatex -interaction=nonstopmode $< >/dev/null
48         pdflatex -interaction=nonstopmode $< >/dev/null
49         pdflatex -interaction=nonstopmode $< >/dev/null
50
51 version.tex: ../version.mk
52         echo '|def|version{$(VERSION)}' | tr '|' '\\' > version.tex
53         echo '|def|pubdate{$(PUBDATE)}' | tr '|' '\\' >> version.tex
54
55 %.1: %.1.in ../version.mk
56         cat $< | sed 's/@PUBDATE@/$(PUBDATE)/' \
57                 | sed 's/@VERSION@/$(VERSION)/' > $@
58
59 clean:
60         rm -f $(MANPAGES) *.bak *.aux *.dvi *.log *.toc *.pdf
61
62 distclean: clean
63         rm -f Makefile
64         
65 install: all
66         install -d $(mandir)/man1
67         install -m 644 ragel.1      $(mandir)/man1/ragel.1
68         install -m 644 rlgen-dot.1  $(mandir)/man1/rlgen-dot.1
69         install -m 644 rlgen-cd.1   $(mandir)/man1/rlgen-cd.1
70         install -m 644 rlgen-java.1 $(mandir)/man1/rlgen-java.1
71         install -m 644 rlgen-ruby.1 $(mandir)/man1/rlgen-ruby.1
72         install -d $(docdir)
73         install -m 644 ragel-guide.pdf $(docdir)/ragel-guide.pdf
74         gzip -c ../ChangeLog > ChangeLog.gz
75         install -m 644 ChangeLog.gz $(docdir)/ChangeLog.gz
76         rm ChangeLog.gz