]>
Commit | Line | Data |
---|---|---|
34136e65 | 1 | ## Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc. |
e2c2f696 AD |
2 | |
3 | ## This program is free software: you can redistribute it and/or modify | |
4 | ## it under the terms of the GNU General Public License as published by | |
5 | ## the Free Software Foundation, either version 3 of the License, or | |
6 | ## (at your option) any later version. | |
7 | ## | |
8 | ## This program is distributed in the hope that it will be useful, | |
9 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | ## GNU General Public License for more details. | |
12 | ## | |
13 | ## You should have received a copy of the GNU General Public License | |
14 | ## along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | ||
16 | AM_MAKEINFOFLAGS = --no-split | |
22b081de | 17 | info_TEXINFOS = doc/bison.texi |
e9690142 JD |
18 | doc_bison_TEXINFOS = \ |
19 | $(CROSS_OPTIONS_TEXI) \ | |
20 | doc/fdl.texi \ | |
e2c2f696 AD |
21 | doc/gpl-3.0.texi |
22 | ||
f039b518 TR |
23 | # Cannot express dependencies directly on file names because of Automake. |
24 | # Obfuscate with a variable. | |
25 | doc_bison = doc/bison | |
26 | $(doc_bison).dvi: $(FIGS_DOT:.dot=.eps) | |
27 | $(doc_bison).pdf: $(FIGS_DOT:.dot=.pdf) | |
bdcbadbe | 28 | $(doc_bison).html: $(FIGS_DOT:.dot=.png) |
f039b518 TR |
29 | |
30 | TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc | |
45d4c012 | 31 | CLEANDIRS = doc/bison.t2d |
e2c2f696 AD |
32 | clean-local: |
33 | rm -rf $(CLEANDIRS) | |
34 | ||
9f14e187 AD |
35 | MOSTLYCLEANFILES += $(top_srcdir)/doc/*.t |
36 | ||
e2c2f696 AD |
37 | CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl |
38 | CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi | |
9f14e187 | 39 | $(CROSS_OPTIONS_TEXI): doc/bison.help $(CROSS_OPTIONS_PL) |
796a2b0a AD |
40 | # Create $@~ which is the previous contents. Don't use `mv' here so |
41 | # that even if we are interrupted, the file is still available for | |
42 | # diff in the next run. Note that $@ might not exist yet. | |
f67c0a1c AD |
43 | $(AM_V_GEN){ test ! -f $@ || cat $@; } >$@~ |
44 | $(AM_V_at)test ! -f $@.tmp || rm -f $@.tmp | |
45 | $(AM_V_at)src/bison$(EXEEXT) --help | \ | |
5aaad6c4 | 46 | $(PERL) $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp |
f67c0a1c AD |
47 | $(AM_V_at)diff -u $@~ $@.tmp || true |
48 | $(AM_V_at)mv $@.tmp $@ | |
e2c2f696 AD |
49 | MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI) |
50 | ||
51 | ## ---------- ## | |
52 | ## Ref card. ## | |
53 | ## ---------- ## | |
54 | ||
55 | EXTRA_DIST += doc/refcard.tex | |
45d4c012 | 56 | CLEANFILES += doc/refcard.pdf |
e2c2f696 | 57 | |
45d4c012 AD |
58 | doc/refcard.pdf: doc/refcard.tex |
59 | $(AM_V_GEN) cd doc && pdftex $(abs_top_srcdir)/doc/refcard.tex | |
e2c2f696 | 60 | |
e2c2f696 AD |
61 | |
62 | ||
9f14e187 AD |
63 | ## ---------------- ## |
64 | ## doc/bison.help. ## | |
65 | ## ---------------- ## | |
66 | ||
67 | # Some of our targets (cross-option.texi, bison.1) use "bison --help". | |
68 | # Since we want to ship the generated file to avoid additional | |
69 | # requirements over the user environment, we used not depend on | |
70 | # src/bison itself, but on src/getargs.c and other files. Yet, we | |
71 | # need "bison --help" to work to make help2man happy, so we used to | |
72 | # include "make src/bison" in the commands. Then we may have a | |
73 | # problem with concurrent builds, since one make might be aiming one | |
74 | # of its jobs at compiling src/bison, and another job at generating | |
75 | # the man page. If the latter is faster than the former, then we have | |
76 | # two makes that concurrently try to compile src/bison. Doomed to | |
77 | # failure. | |
78 | # | |
79 | # As a simple scheme to get our way out, make a stamp file, | |
80 | # bison.help, which contains --version then --help. This file can | |
81 | # depend on bison, which ensures its correctness. But update it | |
82 | # *only* if needed (content changes). This way, we avoid useless | |
83 | # compilations of cross-option.texi and bison.1. At the cost of | |
84 | # repeated builds of bison.help. | |
85 | ||
86 | EXTRA_DIST += $(top_srcdir)/doc/bison.help | |
87 | MAINTAINERCLEANFILES += $(top_srcdir)/doc/bison.help | |
88 | $(top_srcdir)/doc/bison.help: src/bison$(EXEEXT) | |
da83f838 AD |
89 | $(AM_V_GEN)src/bison$(EXEEXT) --version >doc/bison.help.tmp |
90 | $(AM_V_at) src/bison$(EXEEXT) --help >>doc/bison.help.tmp | |
91 | $(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@ | |
9f14e187 AD |
92 | |
93 | ||
e2c2f696 AD |
94 | ## ----------- ## |
95 | ## Man Pages. ## | |
96 | ## ----------- ## | |
97 | ||
98 | dist_man_MANS = $(top_srcdir)/doc/bison.1 | |
99 | ||
9f14e187 | 100 | EXTRA_DIST += $(dist_man_MANS:.1=.x) |
e2c2f696 AD |
101 | MAINTAINERCLEANFILES += $(dist_man_MANS) |
102 | ||
e2c2f696 AD |
103 | # Differences to ignore when comparing the man page (the date). |
104 | remove_time_stamp = \ | |
105 | sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/' | |
106 | ||
9f14e187 AD |
107 | # Depend on configure to get version number changes. |
108 | $(top_srcdir)/doc/bison.1: doc/bison.help doc/bison.x $(top_srcdir)/configure | |
f67c0a1c AD |
109 | $(AM_V_GEN)$(HELP2MAN) \ |
110 | --include=$(top_srcdir)/doc/bison.x \ | |
9f14e187 | 111 | --output=$@.t src/bison$(EXEEXT) |
f67c0a1c | 112 | $(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \ |
e2c2f696 | 113 | $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \ |
f67c0a1c AD |
114 | touch $@; \ |
115 | else \ | |
116 | mv $@.t $@; \ | |
e2c2f696 | 117 | fi |
f67c0a1c | 118 | $(AM_V_at)rm -f $@*.t |
e2c2f696 AD |
119 | |
120 | nodist_man_MANS = doc/yacc.1 | |
121 | ||
d0a30438 AD |
122 | ## ----------------------------- ## |
123 | ## Graphviz examples generation. ## | |
124 | ## ----------------------------- ## | |
125 | ||
126 | CLEANDIRS += doc/figs | |
50977317 AD |
127 | FIGS_DOT = \ |
128 | doc/figs/example.dot \ | |
d42e695e | 129 | doc/figs/example-reduce.dot doc/figs/example-shift.dot |
50977317 AD |
130 | EXTRA_DIST += \ |
131 | $(FIGS_DOT) \ | |
d0a30438 AD |
132 | $(FIGS_DOT:.dot=.eps) $(FIGS_DOT:.dot=.pdf) $(FIGS_DOT:.dot=.png) |
133 | SUFFIXES += .dot .eps .pdf .png | |
134 | ||
d0a30438 AD |
135 | .dot.eps: |
136 | $(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'` | |
137 | $(AM_V_at) $(DOT) -Gmargin=0 -Teps $< >$@.tmp | |
138 | $(AM_V_at) mv $@.tmp $@ | |
139 | ||
140 | .dot.pdf: | |
141 | $(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'` | |
142 | $(AM_V_at) $(DOT) -Gmargin=0 -Tpdf $< >$@.tmp | |
143 | $(AM_V_at) mv $@.tmp $@ | |
144 | ||
145 | .dot.png: | |
146 | $(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'` | |
147 | $(AM_V_at) $(DOT) -Gmargin=0 -Tpng $< >$@.tmp | |
148 | $(AM_V_at) mv $@.tmp $@ | |
149 | ||
e2c2f696 AD |
150 | ## -------------- ## |
151 | ## Doxygenation. ## | |
152 | ## -------------- ## | |
153 | ||
154 | DOXYGEN = doxygen | |
155 | ||
156 | .PHONY: doc html | |
157 | ||
158 | doc: html | |
159 | ||
160 | html-local: doc/Doxyfile | |
ed3c2b91 | 161 | $(AM_V_GEN) $(DOXYGEN) doc/Doxyfile |
e2c2f696 AD |
162 | |
163 | edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \ | |
164 | -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ | |
5aaad6c4 | 165 | -e 's,@PERL\@,$(PERL),g' \ |
e2c2f696 AD |
166 | -e 's,@top_builddir\@,$(top_builddir),g' \ |
167 | -e 's,@top_srcdir\@,$(top_srcdir),g' | |
168 | ||
169 | EXTRA_DIST += doc/Doxyfile.in | |
170 | CLEANFILES += doc/Doxyfile | |
171 | # Sed is used to generate Doxyfile from Doxyfile.in instead of | |
172 | # configure, because the former is way faster than the latter. | |
173 | doc/Doxyfile: $(top_srcdir)/doc/Doxyfile.in | |
f67c0a1c | 174 | $(AM_V_GEN) $(edit) $(top_srcdir)/doc/Doxyfile.in >doc/Doxyfile |
e2c2f696 | 175 | |
ed3c2b91 | 176 | CLEANDIRS += doc/html |