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