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