]>
Commit | Line | Data |
---|---|---|
e2c2f696 AD |
1 | ## Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2008 Free Software |
2 | ## Foundation, Inc. | |
3 | ||
4 | ## This program is free software: you can redistribute it and/or modify | |
5 | ## it under the terms of the GNU General Public License as published by | |
6 | ## the Free Software Foundation, either version 3 of the License, or | |
7 | ## (at your option) any later version. | |
8 | ## | |
9 | ## This program is distributed in the hope that it will be useful, | |
10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | ## GNU General Public License for more details. | |
13 | ## | |
14 | ## You should have received a copy of the GNU General Public License | |
15 | ## along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | ||
17 | AM_MAKEINFOFLAGS = --no-split | |
18 | info_TEXINFOS = doc/bison.texinfo | |
19 | doc_bison_TEXINFOS = \ | |
20 | $(CROSS_OPTIONS_TEXI) \ | |
21 | doc/fdl.texi \ | |
22 | doc/gpl-3.0.texi | |
23 | ||
24 | CLEANFILES = doc/bison.fns | |
25 | CLEANDIRS = doc/*.t2d | |
26 | clean-local: | |
27 | rm -rf $(CLEANDIRS) | |
28 | ||
29 | CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl | |
30 | CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi | |
31 | $(CROSS_OPTIONS_TEXI): $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL) | |
01466c3e AD |
32 | mv -f $@ $@~ || : >$@~ |
33 | -rm -f $@.tmp | |
23ce6f4c | 34 | $(MAKE) $(AM_MAKEFLAGS) src/bison$(EXEEXT) |
a7c09cba DJ |
35 | $(top_builddir)/src/bison --help | \ |
36 | perl $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp | |
01466c3e | 37 | diff -u $@~ $@.tmp || true |
e2c2f696 AD |
38 | mv $@.tmp $@ |
39 | MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI) | |
40 | ||
41 | ## ---------- ## | |
42 | ## Ref card. ## | |
43 | ## ---------- ## | |
44 | ||
45 | EXTRA_DIST += doc/refcard.tex | |
46 | CLEANFILES += doc/refcard.dvi doc/refcard.log doc/refcard.ps | |
47 | ||
48 | doc/refcard.dvi: doc/refcard.tex | |
49 | cd doc && tex refcard.tex | |
50 | ||
51 | doc/refcard.ps: doc/refcard.dvi | |
52 | ||
53 | ||
54 | ## ----------- ## | |
55 | ## Man Pages. ## | |
56 | ## ----------- ## | |
57 | ||
58 | dist_man_MANS = $(top_srcdir)/doc/bison.1 | |
59 | ||
60 | EXTRA_DIST += $(dist_man_MANS:.1=.x) doc/common.x | |
61 | MAINTAINERCLEANFILES += $(dist_man_MANS) | |
62 | ||
63 | # Depend on configure to get version number changes. | |
64 | common_dep = $(top_srcdir)/configure $(top_srcdir)/doc/common.x | |
65 | $(top_srcdir)/doc/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c | |
66 | ||
67 | # Differences to ignore when comparing the man page (the date). | |
68 | remove_time_stamp = \ | |
69 | sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/' | |
70 | ||
71 | MOSTLYCLEANFILES += $(top_srcdir)/doc/*.t | |
72 | ||
73 | SUFFIXES = .x .1 | |
74 | ||
75 | PREPATH = src | |
76 | .x.1: | |
77 | @program=`expr "/$*" : '.*/\(.*\)'` && \ | |
78 | save_IFS=$IFS; \ | |
79 | IFS=$(PATH_SEPARATOR); \ | |
80 | for dir in $(PREPATH); do \ | |
81 | IFS=$save_IFS; \ | |
82 | echo $(MAKE) $(AM_MAKEFLAGS) $$dir/$$program; \ | |
83 | $(MAKE) $(AM_MAKEFLAGS) $$dir/$$program || exit; \ | |
84 | done | |
85 | @echo "Updating man page $@" | |
86 | PATH="$(top_builddir)/$(PREPATH)$(PATH_SEPARATOR)$$PATH"; \ | |
87 | export PATH; \ | |
88 | $(HELP2MAN) \ | |
89 | --include=$*.x \ | |
90 | --include=$(top_srcdir)/doc/common.x \ | |
91 | --output=$@.t `echo '$*' | sed 's,.*/,,'` | |
92 | if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \ | |
93 | $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \ | |
94 | touch $@; \ | |
95 | else \ | |
96 | mv $@.t $@; \ | |
97 | fi | |
98 | rm -f $@*.t | |
99 | ||
100 | nodist_man_MANS = doc/yacc.1 | |
101 | ||
102 | ## -------------- ## | |
103 | ## Doxygenation. ## | |
104 | ## -------------- ## | |
105 | ||
106 | DOXYGEN = doxygen | |
107 | ||
108 | .PHONY: doc html | |
109 | ||
110 | doc: html | |
111 | ||
112 | html-local: doc/Doxyfile | |
113 | cd doc && $(DOXYGEN) | |
114 | ||
115 | edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \ | |
116 | -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ | |
117 | -e 's,@top_builddir\@,$(top_builddir),g' \ | |
118 | -e 's,@top_srcdir\@,$(top_srcdir),g' | |
119 | ||
120 | EXTRA_DIST += doc/Doxyfile.in | |
121 | CLEANFILES += doc/Doxyfile | |
122 | # Sed is used to generate Doxyfile from Doxyfile.in instead of | |
123 | # configure, because the former is way faster than the latter. | |
124 | doc/Doxyfile: $(top_srcdir)/doc/Doxyfile.in | |
125 | $(edit) $(top_srcdir)/doc/Doxyfile.in >doc/Doxyfile | |
126 | ||
127 | CLEANDIRS += html latex |