]> git.saurik.com Git - bison.git/blob - doc/Makefile.am
* NEWS: Version 2.3b.
[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 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 = bison.texinfo
19 bison_TEXINFOS = $(srcdir)/cross-options.texi gpl-3.0.texi fdl.texi
20
21 CLEANFILES = bison.fns
22 CLEANDIRS = *.t2d
23 clean-local:
24 rm -rf $(CLEANDIRS)
25
26 CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
27 $(srcdir)/cross-options.texi: $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL)
28 -rm -f $@ $@.tmp
29 cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
30 $(top_builddir)/src/bison --help | perl $(CROSS_OPTIONS_PL) >$@.tmp
31 mv $@.tmp $@
32 MAINTAINERCLEANFILES = $(srcdir)/cross-options.texi
33
34 ## ---------- ##
35 ## Ref card. ##
36 ## ---------- ##
37
38 EXTRA_DIST = refcard.tex
39 CLEANFILES += refcard.dvi refcard.log refcard.ps
40
41 refcard.dvi: refcard.tex
42 tex refcard.tex
43
44 refcard.ps: refcard.dvi
45
46
47 ## ----------- ##
48 ## Man Pages. ##
49 ## ----------- ##
50
51 dist_man_MANS = $(srcdir)/bison.1
52
53 EXTRA_DIST += $(dist_man_MANS:.1=.x) common.x
54 MAINTAINERCLEANFILES += $(dist_man_MANS)
55
56 # Depend on configure.ac to get version number changes.
57 common_dep = $(top_srcdir)/configure.ac $(srcdir)/common.x
58 srcsrcdir = $(top_srcdir)/bin
59 $(srcdir)/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
60
61 # Output from --help and --version that must not appear in the man page.
62 neutralize = \
63 perl -0777 -pi -e 's/\.PP\nId:.*\n//g'
64
65 # Differences to ignore when comparing the man page (the date).
66 remove_time_stamp = \
67 sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
68
69 MOSTLYCLEANFILES = $(srcdir)/*.t
70
71 SUFFIXES = .x .1
72
73 PREPATH = $(top_builddir)/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 cd $$dir '&&' $(MAKE) $(AM_MAKEFLAGS) $$program && \
81 (cd $$dir && $(MAKE) $(AM_MAKEFLAGS) $$program) || exit; \
82 done
83 @echo "Updating man page $@"
84 PATH="$(PREPATH)$(PATH_SEPARATOR)$$PATH"; \
85 export PATH; \
86 $(HELP2MAN) \
87 --include=$*.x \
88 --include=$(srcdir)/common.x \
89 --output=$@.t `echo '$*' | sed 's,.*/,,'`
90 $(neutralize) $@.t
91 if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
92 $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
93 touch $@; \
94 else \
95 mv $@.t $@; \
96 fi
97 rm -f $@*.t
98
99 nodist_man_MANS = yacc.1
100
101 ## -------------- ##
102 ## Doxygenation. ##
103 ## -------------- ##
104
105 DOXYGEN = doxygen
106
107 .PHONY: doc html
108
109 doc: html
110
111 html-local: Doxyfile
112 $(DOXYGEN)
113
114 edit = sed -e "s|@ID@|$$Id|" \
115 -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 += Doxyfile.in
121 CLEANFILES += 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 # Moreover, this file is updated whenever ChangeLog is touched: using
125 # sed instead of configure saves us a lot of time.
126 Doxyfile: $(top_srcdir)/ChangeLog $(srcdir)/Doxyfile.in
127 Id=`grep '^\$$Id' $(top_srcdir)/ChangeLog`; \
128 $(edit) $(srcdir)/Doxyfile.in >Doxyfile
129
130 CLEANDIRS += html latex