]>
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 | |
17 | info_TEXINFOS = doc/bison.texinfo | |
e9690142 JD |
18 | doc_bison_TEXINFOS = \ |
19 | $(CROSS_OPTIONS_TEXI) \ | |
20 | doc/fdl.texi \ | |
e2c2f696 AD |
21 | doc/gpl-3.0.texi |
22 | ||
23 | CLEANFILES = doc/bison.fns | |
24 | CLEANDIRS = doc/*.t2d | |
25 | clean-local: | |
26 | rm -rf $(CLEANDIRS) | |
27 | ||
9f14e187 AD |
28 | MOSTLYCLEANFILES += $(top_srcdir)/doc/*.t |
29 | ||
e2c2f696 AD |
30 | CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl |
31 | CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi | |
9f14e187 | 32 | $(CROSS_OPTIONS_TEXI): doc/bison.help $(CROSS_OPTIONS_PL) |
796a2b0a AD |
33 | # Create $@~ which is the previous contents. Don't use `mv' here so |
34 | # that even if we are interrupted, the file is still available for | |
35 | # diff in the next run. Note that $@ might not exist yet. | |
f67c0a1c AD |
36 | $(AM_V_GEN){ test ! -f $@ || cat $@; } >$@~ |
37 | $(AM_V_at)test ! -f $@.tmp || rm -f $@.tmp | |
38 | $(AM_V_at)src/bison$(EXEEXT) --help | \ | |
796a2b0a | 39 | perl $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp |
f67c0a1c AD |
40 | $(AM_V_at)diff -u $@~ $@.tmp || true |
41 | $(AM_V_at)mv $@.tmp $@ | |
e2c2f696 AD |
42 | MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI) |
43 | ||
44 | ## ---------- ## | |
45 | ## Ref card. ## | |
46 | ## ---------- ## | |
47 | ||
48 | EXTRA_DIST += doc/refcard.tex | |
49 | CLEANFILES += doc/refcard.dvi doc/refcard.log doc/refcard.ps | |
50 | ||
51 | doc/refcard.dvi: doc/refcard.tex | |
f67c0a1c | 52 | $(AM_V_GEN)cd doc && tex refcard.tex |
e2c2f696 AD |
53 | |
54 | doc/refcard.ps: doc/refcard.dvi | |
55 | ||
56 | ||
9f14e187 AD |
57 | ## ---------------- ## |
58 | ## doc/bison.help. ## | |
59 | ## ---------------- ## | |
60 | ||
61 | # Some of our targets (cross-option.texi, bison.1) use "bison --help". | |
62 | # Since we want to ship the generated file to avoid additional | |
63 | # requirements over the user environment, we used not depend on | |
64 | # src/bison itself, but on src/getargs.c and other files. Yet, we | |
65 | # need "bison --help" to work to make help2man happy, so we used to | |
66 | # include "make src/bison" in the commands. Then we may have a | |
67 | # problem with concurrent builds, since one make might be aiming one | |
68 | # of its jobs at compiling src/bison, and another job at generating | |
69 | # the man page. If the latter is faster than the former, then we have | |
70 | # two makes that concurrently try to compile src/bison. Doomed to | |
71 | # failure. | |
72 | # | |
73 | # As a simple scheme to get our way out, make a stamp file, | |
74 | # bison.help, which contains --version then --help. This file can | |
75 | # depend on bison, which ensures its correctness. But update it | |
76 | # *only* if needed (content changes). This way, we avoid useless | |
77 | # compilations of cross-option.texi and bison.1. At the cost of | |
78 | # repeated builds of bison.help. | |
79 | ||
80 | EXTRA_DIST += $(top_srcdir)/doc/bison.help | |
81 | MAINTAINERCLEANFILES += $(top_srcdir)/doc/bison.help | |
82 | $(top_srcdir)/doc/bison.help: src/bison$(EXEEXT) | |
f67c0a1c AD |
83 | $(AM_V_GEN)$< --version >doc/bison.help.t |
84 | $(AM_V_at)$< --help >>doc/bison.help.t | |
85 | $(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.t $@ | |
9f14e187 AD |
86 | |
87 | ||
e2c2f696 AD |
88 | ## ----------- ## |
89 | ## Man Pages. ## | |
90 | ## ----------- ## | |
91 | ||
92 | dist_man_MANS = $(top_srcdir)/doc/bison.1 | |
93 | ||
9f14e187 | 94 | EXTRA_DIST += $(dist_man_MANS:.1=.x) |
e2c2f696 AD |
95 | MAINTAINERCLEANFILES += $(dist_man_MANS) |
96 | ||
e2c2f696 AD |
97 | # Differences to ignore when comparing the man page (the date). |
98 | remove_time_stamp = \ | |
99 | sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/' | |
100 | ||
9f14e187 AD |
101 | # Depend on configure to get version number changes. |
102 | $(top_srcdir)/doc/bison.1: doc/bison.help doc/bison.x $(top_srcdir)/configure | |
f67c0a1c AD |
103 | $(AM_V_GEN)$(HELP2MAN) \ |
104 | --include=$(top_srcdir)/doc/bison.x \ | |
9f14e187 | 105 | --output=$@.t src/bison$(EXEEXT) |
f67c0a1c | 106 | $(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \ |
e2c2f696 | 107 | $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \ |
f67c0a1c AD |
108 | touch $@; \ |
109 | else \ | |
110 | mv $@.t $@; \ | |
e2c2f696 | 111 | fi |
f67c0a1c | 112 | $(AM_V_at)rm -f $@*.t |
e2c2f696 AD |
113 | |
114 | nodist_man_MANS = doc/yacc.1 | |
115 | ||
116 | ## -------------- ## | |
117 | ## Doxygenation. ## | |
118 | ## -------------- ## | |
119 | ||
120 | DOXYGEN = doxygen | |
121 | ||
122 | .PHONY: doc html | |
123 | ||
124 | doc: html | |
125 | ||
126 | html-local: doc/Doxyfile | |
f67c0a1c | 127 | $(AM_V_GEN) cd doc && $(DOXYGEN) |
e2c2f696 AD |
128 | |
129 | edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \ | |
130 | -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ | |
131 | -e 's,@top_builddir\@,$(top_builddir),g' \ | |
132 | -e 's,@top_srcdir\@,$(top_srcdir),g' | |
133 | ||
134 | EXTRA_DIST += doc/Doxyfile.in | |
135 | CLEANFILES += doc/Doxyfile | |
136 | # Sed is used to generate Doxyfile from Doxyfile.in instead of | |
137 | # configure, because the former is way faster than the latter. | |
138 | doc/Doxyfile: $(top_srcdir)/doc/Doxyfile.in | |
f67c0a1c | 139 | $(AM_V_GEN) $(edit) $(top_srcdir)/doc/Doxyfile.in >doc/Doxyfile |
e2c2f696 AD |
140 | |
141 | CLEANDIRS += html latex |