]> git.saurik.com Git - bison.git/blob - doc/local.mk
Don't let maintainer-*-check targets force a version update.
[bison.git] / doc / local.mk
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)
32 -rm -f $@ $@.tmp
33 $(MAKE) $(AM_MAKEFLAGS) src/bison$(EXEEXT)
34 $(top_builddir)/src/bison --help | perl $(CROSS_OPTIONS_PL) >$@.tmp
35 mv $@.tmp $@
36 MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI)
37
38 ## ---------- ##
39 ## Ref card. ##
40 ## ---------- ##
41
42 EXTRA_DIST += doc/refcard.tex
43 CLEANFILES += doc/refcard.dvi doc/refcard.log doc/refcard.ps
44
45 doc/refcard.dvi: doc/refcard.tex
46 cd doc && tex refcard.tex
47
48 doc/refcard.ps: doc/refcard.dvi
49
50
51 ## ----------- ##
52 ## Man Pages. ##
53 ## ----------- ##
54
55 dist_man_MANS = $(top_srcdir)/doc/bison.1
56
57 EXTRA_DIST += $(dist_man_MANS:.1=.x) doc/common.x
58 MAINTAINERCLEANFILES += $(dist_man_MANS)
59
60 # Depend on configure to get version number changes.
61 common_dep = $(top_srcdir)/configure $(top_srcdir)/doc/common.x
62 $(top_srcdir)/doc/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
63
64 # Differences to ignore when comparing the man page (the date).
65 remove_time_stamp = \
66 sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
67
68 MOSTLYCLEANFILES += $(top_srcdir)/doc/*.t
69
70 SUFFIXES = .x .1
71
72 PREPATH = src
73 .x.1:
74 @program=`expr "/$*" : '.*/\(.*\)'` && \
75 save_IFS=$IFS; \
76 IFS=$(PATH_SEPARATOR); \
77 for dir in $(PREPATH); do \
78 IFS=$save_IFS; \
79 echo $(MAKE) $(AM_MAKEFLAGS) $$dir/$$program; \
80 $(MAKE) $(AM_MAKEFLAGS) $$dir/$$program || exit; \
81 done
82 @echo "Updating man page $@"
83 PATH="$(top_builddir)/$(PREPATH)$(PATH_SEPARATOR)$$PATH"; \
84 export PATH; \
85 $(HELP2MAN) \
86 --include=$*.x \
87 --include=$(top_srcdir)/doc/common.x \
88 --output=$@.t `echo '$*' | sed 's,.*/,,'`
89 if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
90 $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
91 touch $@; \
92 else \
93 mv $@.t $@; \
94 fi
95 rm -f $@*.t
96
97 nodist_man_MANS = doc/yacc.1
98
99 ## -------------- ##
100 ## Doxygenation. ##
101 ## -------------- ##
102
103 DOXYGEN = doxygen
104
105 .PHONY: doc html
106
107 doc: html
108
109 html-local: doc/Doxyfile
110 cd doc && $(DOXYGEN)
111
112 edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
113 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
114 -e 's,@top_builddir\@,$(top_builddir),g' \
115 -e 's,@top_srcdir\@,$(top_srcdir),g'
116
117 EXTRA_DIST += doc/Doxyfile.in
118 CLEANFILES += doc/Doxyfile
119 # Sed is used to generate Doxyfile from Doxyfile.in instead of
120 # configure, because the former is way faster than the latter.
121 doc/Doxyfile: $(top_srcdir)/doc/Doxyfile.in
122 $(edit) $(top_srcdir)/doc/Doxyfile.in >doc/Doxyfile
123
124 CLEANDIRS += html latex