* depend.am: Add @AMDEP@ before `include', so that dependency
[automake.git] / lib / am / texinfos.am
blob117da12b25587cf91f3c450b1a17e965bec7f05e
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994-98, 1999 Free Software Foundation, Inc.
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.
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.
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.
19 ## FIXME: should repeat all the stuff in this file.  Instead should
20 ## generate the contents in a smarter way.
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) $<
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) $<
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) $<
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) $<
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) $<
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) $<
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) $<
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) $<
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) $<
130 ## The way to make PostScript, for those who want it.
131 DVIPS = dvips
132 .dvi.ps:
133         $(DVIPS) $< -o $@
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) $(DESTDIR)$(infodir)
143         @list='$(INFO_DEPS)'; \
144         for file in $$list; do \
145 CYGNUS    if test -f $$file; then d=.; else d=$(srcdir); fi; \
146 NOTCYGNUS         d=$(srcdir); \
147 ## We use these strange circumlocutions because we want the "ifile" to
148 ## be relative, for the install.
149           for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
150             if test -f $$d/$$ifile; then \
151               echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
152               $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
153             else : ; fi; \
154           done; \
155         done
156         @$(POST_INSTALL)
157 ## Only run this code if install-info actually exists, and it is not
158 ## the Debian install-info.  FIXME: once Debian install-info goes
159 ## away, we can remove this hack.
160         @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
161           list='$(INFO_DEPS)'; \
162           for file in $$list; do \
163 ## Run `:' after install-info in case install-info fails.  We really
164 ## don't care about failures here, because they can be spurious.  For
165 ## instance if you don't have a dir file, install-info will fail.  I
166 ## think instead it should create a new dir file for you.  This bug
167 ## causes the `make distcheck' target to fail reliably.
168             echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
169 ## Use `|| :' here because Sun make passes -e to sh; if install-info
170 ## fails then we'd fail if we used `;'.
171             install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
172           done; \
173         else : ; fi
175 uninstall-info:
176         $(PRE_UNINSTALL)
177 ## Run two loops here so that we can handle PRE_UNINSTALL and
178 ## NORMAL_UNINSTALL correctly.
179         @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
180           list='$(INFO_DEPS)'; \
181           for file in $$list; do \
182             echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file"; \
183             install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
184           done; \
185         else :; fi
186         @$(NORMAL_UNINSTALL)
187         @list='$(INFO_DEPS)'; \
188         for file in $$list; do \
189           (if cd $(DESTDIR)$(infodir); then \
190              echo " rm -f $$file $$file-[0-9] $$file-[0-9][0-9])"; \
191              rm -f $$file $$file-[0-9] $$file-[0-9][0-9]; \
192            else :; fi); \
193         done
195 dist-info: $(INFO_DEPS)
196         list='$(INFO_DEPS)'; \
197         for base in $$list; do \
198 ## In Cygnus mode, allow info file to be in source or build dir.  In
199 ## other modes, allow only source dir.
200 NOTCYGNUS         d=$(srcdir); \
201 CYGNUS    if test -f $$base; then d=.; else d=$(srcdir); fi; \
202           for file in `cd $$d && eval echo $$base*`; do \
203             test -f $(distdir)/$$file \
204             || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
205             || cp -p $$d/$$file $(distdir)/$$file; \
206           done; \
207         done