]> git.saurik.com Git - bison.git/blob - doc/local.mk
Warn about character literals not of length one.
[bison.git] / doc / local.mk
1 ## Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009
2 ## Free Software 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 # Create $@~ which is the previous contents. Don't use `mv' here so
33 # that even if we are interrupted, the file is still available for
34 # diff in the next run. Note that $@ might not exist yet.
35 { test ! -f $@ || cat $@; } >$@~
36 test ! -f $@.tmp || rm -f $@.tmp
37 $(MAKE) $(AM_MAKEFLAGS) src/bison$(EXEEXT)
38 $(top_builddir)/src/bison --help | \
39 perl $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
40 diff -u $@~ $@.tmp || true
41 mv $@.tmp $@
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
52 cd doc && tex refcard.tex
53
54 doc/refcard.ps: doc/refcard.dvi
55
56
57 ## ----------- ##
58 ## Man Pages. ##
59 ## ----------- ##
60
61 dist_man_MANS = $(top_srcdir)/doc/bison.1
62
63 EXTRA_DIST += $(dist_man_MANS:.1=.x) doc/common.x
64 MAINTAINERCLEANFILES += $(dist_man_MANS)
65
66 # Depend on configure to get version number changes.
67 common_dep = $(top_srcdir)/configure $(top_srcdir)/doc/common.x
68 $(top_srcdir)/doc/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
69
70 # Differences to ignore when comparing the man page (the date).
71 remove_time_stamp = \
72 sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
73
74 MOSTLYCLEANFILES += $(top_srcdir)/doc/*.t
75
76 SUFFIXES = .x .1
77
78 PREPATH = src
79 .x.1:
80 @program=`expr "/$*" : '.*/\(.*\)'` && \
81 save_IFS=$IFS; \
82 IFS=$(PATH_SEPARATOR); \
83 for dir in $(PREPATH); do \
84 IFS=$save_IFS; \
85 echo $(MAKE) $(AM_MAKEFLAGS) $$dir/$$program; \
86 $(MAKE) $(AM_MAKEFLAGS) $$dir/$$program || exit; \
87 done
88 @echo "Updating man page $@"
89 PATH="$(top_builddir)/$(PREPATH)$(PATH_SEPARATOR)$$PATH"; \
90 export PATH; \
91 $(HELP2MAN) \
92 --include=$*.x \
93 --include=$(top_srcdir)/doc/common.x \
94 --output=$@.t `echo '$*' | sed 's,.*/,,'`
95 if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
96 $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
97 touch $@; \
98 else \
99 mv $@.t $@; \
100 fi
101 rm -f $@*.t
102
103 nodist_man_MANS = doc/yacc.1
104
105 ## -------------- ##
106 ## Doxygenation. ##
107 ## -------------- ##
108
109 DOXYGEN = doxygen
110
111 .PHONY: doc html
112
113 doc: html
114
115 html-local: doc/Doxyfile
116 cd doc && $(DOXYGEN)
117
118 edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
119 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
120 -e 's,@top_builddir\@,$(top_builddir),g' \
121 -e 's,@top_srcdir\@,$(top_srcdir),g'
122
123 EXTRA_DIST += doc/Doxyfile.in
124 CLEANFILES += doc/Doxyfile
125 # Sed is used to generate Doxyfile from Doxyfile.in instead of
126 # configure, because the former is way faster than the latter.
127 doc/Doxyfile: $(top_srcdir)/doc/Doxyfile.in
128 $(edit) $(top_srcdir)/doc/Doxyfile.in >doc/Doxyfile
129
130 CLEANDIRS += html latex