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