reimplemented man pages
[platform/upstream/automake.git] / lib / am / texinfos.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994, 1995, 1996, 1997, 1998 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 2, or (at your option)
7 ## 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, write to the Free Software
16 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 ## 02111-1307, USA.
18
19 ## FIXME: should repeat all the stuff in this file.  Instead should
20 ## generate the contents in a smarter way.
21
22 .texi.info:
23 ## We want to force the .info file to be built in srcdir.  This is
24 ## probably the simplest way.  However, at Cygnus .info files are
25 ## always put into the build directory.  So at runtime we select which
26 ## rule to use.
27 ## Note that we also remove the possible output files before running
28 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
29 ## using --no-split), you'll be left with some dead info files lying
30 ## around -- dead files which will end up in the distribution.
31 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
32 NOTCYGNUS       cd $(srcdir) \
33 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
34 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
35 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
36
37 .texi.dvi:
38         TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \
39 ## Must set MAKEINFO like this so that version.texi will be found even
40 ## if it is in srcdir.
41           MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
42
43 .texi:
44 ## We want to force the .info file to be built in srcdir.  This is
45 ## probably the simplest way.  However, at Cygnus .info files are
46 ## always put into the build directory.  So at runtime we select which
47 ## rule to use.
48 ## Note that we also remove the possible output files before running
49 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
50 ## using --no-split), you'll be left with some dead info files lying
51 ## around -- dead files which will end up in the distribution.
52 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
53 NOTCYGNUS       cd $(srcdir) \
54 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
55 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
56 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
57
58 .texinfo.info:
59 ## We want to force the .info file to be built in srcdir.  This is
60 ## probably the simplest way.  However, at Cygnus .info files are
61 ## always put into the build directory.  So at runtime we select which
62 ## rule to use.
63 ## Note that we also remove the possible output files before running
64 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
65 ## using --no-split), you'll be left with some dead info files lying
66 ## around -- dead files which will end up in the distribution.
67 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
68 NOTCYGNUS       cd $(srcdir) \
69 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
70 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
71 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
72
73 .texinfo:
74 ## We want to force the .info file to be built in srcdir.  This is
75 ## probably the simplest way.  However, at Cygnus .info files are
76 ## always put into the build directory.  So at runtime we select which
77 ## rule to use.
78 ## Note that we also remove the possible output files before running
79 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
80 ## using --no-split), you'll be left with some dead info files lying
81 ## around -- dead files which will end up in the distribution.
82 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
83 NOTCYGNUS       cd $(srcdir) \
84 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
85 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
86 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
87
88 .texinfo.dvi:
89         TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \
90 ## Must set MAKEINFO like this so that version.texi will be found even
91 ## if it is in srcdir.
92           MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
93
94 .txi.info:
95 ## We want to force the .info file to be built in srcdir.  This is
96 ## probably the simplest way.  However, at Cygnus .info files are
97 ## always put into the build directory.  So at runtime we select which
98 ## rule to use.
99 ## Note that we also remove the possible output files before running
100 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
101 ## using --no-split), you'll be left with some dead info files lying
102 ## around -- dead files which will end up in the distribution.
103 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
104 NOTCYGNUS       cd $(srcdir) \
105 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
106 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
107 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
108
109 .txi.dvi:
110         TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \
111 ## Must set MAKEINFO like this so that version.texi will be found even
112 ## if it is in srcdir.
113           MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
114
115 .txi:
116 ## We want to force the .info file to be built in srcdir.  This is
117 ## probably the simplest way.  However, at Cygnus .info files are
118 ## always put into the build directory.  So at runtime we select which
119 ## rule to use.
120 ## Note that we also remove the possible output files before running
121 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
122 ## using --no-split), you'll be left with some dead info files lying
123 ## around -- dead files which will end up in the distribution.
124 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
125 NOTCYGNUS       cd $(srcdir) \
126 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
127 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
128 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
129
130 ## The way to make PostScript, for those who want it.
131 DVIPS = dvips
132 .dvi.ps:
133         $(DVIPS) $< -o $@
134
135 ## Look in both . and srcdir because the info pages might have been
136 ## rebuilt in the build directory.  Can't cd to srcdir; that might
137 ## break a possible install-sh reference.
138 ## Funny name due to --cygnus influence; we want to reserve
139 ## `install-info' for the user.
140 install-info-am: $(INFO_DEPS)
141         @$(NORMAL_INSTALL)
142         $(mkinstalldirs) $(infodir)
143         @for file in $(INFO_DEPS); do \
144 CYGNUS    if test -f $$file; then d=.; else d=$(srcdir); fi; \
145 NOTCYGNUS         d=$(srcdir); \
146 ## We use these strange circumlocutions because we want the "ifile" to
147 ## be relative, for the install.
148           for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
149             if test -f $$d/$$ifile; then \
150               echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
151               $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
152             else : ; fi; \
153           done; \
154         done
155         @$(POST_INSTALL)
156 ## Only run this code if install-info actually exists, and it is not
157 ## the Debian install-info.  FIXME: once Debian install-info goes
158 ## away, we can remove this hack.
159         @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
160           for file in $(INFO_DEPS); do \
161 ## Run `:' after install-info in case install-info fails.  We really
162 ## don't care about failures here, because they can be spurious.  For
163 ## instance if you don't have a dir file, install-info will fail.  I
164 ## think instead it should create a new dir file for you.  This bug
165 ## causes the `make distcheck' target to fail reliably.
166             echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
167 ## Use `|| :' here because Sun make passes -e to sh; if install-info
168 ## fails then we'd fail if we used `;'.
169             install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
170           done; \
171         else : ; fi
172
173 uninstall-info:
174         $(PRE_UNINSTALL)
175 ## Run two loops here so that we can handle PRE_UNINSTALL and
176 ## NORMAL_UNINSTALL correctly.
177         @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
178           ii=yes; \
179         else ii=; fi; \
180         for file in $(INFO_DEPS); do \
181           test -z "$ii" \
182             || install-info --info-dir=$(infodir) --remove $$file; \
183         done
184         @$(NORMAL_UNINSTALL)
185         for file in $(INFO_DEPS); do \
186           (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
187         done
188
189 dist-info: $(INFO_DEPS)
190         for base in $(INFO_DEPS); do \
191 ## In Cygnus mode, allow info file to be in source or build dir.  In
192 ## other modes, allow only source dir.
193 NOTCYGNUS         d=$(srcdir); \
194 CYGNUS    if test -f $$base; then d=.; else d=$(srcdir); fi; \
195           for file in `cd $$d && eval echo $$base*`; do \
196             test -f $(distdir)/$$file \
197             || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
198             || cp -p $$d/$$file $(distdir)/$$file; \
199           done; \
200         done