]> git.saurik.com Git - bison.git/blob - doc/Makefile.am
9cf734c8614c1a88ca6a6e354eeb2c1042ccf5cc
[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 = cross-options.texi gpl-3.0.texi fdl.texi
20
21 CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
22 $(srcdir)/cross-options.texi: $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL)
23 -rm -f $@ $@.tmp
24 cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
25 $(top_builddir)/src/bison --help | perl $(CROSS_OPTIONS_PL) >$@.tmp
26 mv $@.tmp $@
27
28 CLEANFILES = bison.fns
29 CLEANDIRS = *.t2d
30 clean-local:
31 rm -rf $(CLEANDIRS)
32
33 ## ---------- ##
34 ## Ref card. ##
35 ## ---------- ##
36
37 EXTRA_DIST = refcard.tex
38
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 remove_time_stamp = 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
62
63 MOSTLYCLEANFILES = $(srcdir)/*.t
64
65 SUFFIXES = .x .1
66
67 PREPATH = $(top_builddir)/src
68 .x.1:
69 @program=`expr "/$*" : '.*/\(.*\)'` && \
70 save_IFS=$IFS; \
71 IFS=$(PATH_SEPARATOR); \
72 for dir in $(PREPATH); do \
73 IFS=$save_IFS; \
74 echo cd $$dir '&&' $(MAKE) $(AM_MAKEFLAGS) $$program && \
75 (cd $$dir && $(MAKE) $(AM_MAKEFLAGS) $$program) || exit; \
76 done
77 @echo "Updating man page $@"
78 PATH="$(PREPATH)$(PATH_SEPARATOR)$$PATH"; \
79 export PATH; \
80 $(HELP2MAN) \
81 --include=$*.x \
82 --include=$(srcdir)/common.x \
83 --output=$@.t `echo '$*' | sed 's,.*/,,'`
84 if sed $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
85 sed $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
86 touch $@; \
87 else \
88 mv $@.t $@; \
89 fi
90 rm -f $@*.t
91
92
93 ## -------------- ##
94 ## Doxygenation. ##
95 ## -------------- ##
96
97 DOXYGEN = doxygen
98
99 .PHONY: doc html
100
101 doc: html
102
103 html-local: Doxyfile
104 $(DOXYGEN)
105
106 edit = sed -e "s|@ID@|$$Id|" \
107 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
108 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
109 -e 's,@top_builddir\@,$(top_builddir),g' \
110 -e 's,@top_srcdir\@,$(top_srcdir),g'
111
112 EXTRA_DIST += Doxyfile.in
113 CLEANFILES += Doxyfile
114 # Sed is used to generate Doxyfile from Doxyfile.in instead of
115 # configure, because the former is way faster than the latter.
116 # Moreover, this file is updated whenever ChangeLog is touched: using
117 # sed instead of configure saves us a lot of time.
118 Doxyfile: $(top_srcdir)/ChangeLog $(srcdir)/Doxyfile.in
119 Id=`grep '^\$$Id' $(top_srcdir)/ChangeLog`; \
120 $(edit) $(srcdir)/Doxyfile.in >Doxyfile
121
122 CLEANDIRS += html latex