* tests/Makefile.am (XFAIL_TESTS): Removed distcommon.test.
[automake.git] / texinfos.am
blob013fb301928ac260b45d256b5bdf97226dd0e1fc
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
3 ## Free Software Foundation, Inc.
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
8 ## any later version.
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 ## 02111-1307, USA.
20 ## FIXME: should repeat all the stuff in this file.  Instead should
21 ## generate the contents in a smarter way.
23 .texi.info:
24 ## We want to force the .info file to be built in srcdir.  This is
25 ## probably the simplest way.  However, at Cygnus .info files are
26 ## always put into the build directory.  So at runtime we select which
27 ## rule to use.
28 ## Note that we also remove the possible output files before running
29 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
30 ## using --no-split), you'll be left with some dead info files lying
31 ## around -- dead files which will end up in the distribution.
32 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
33 NOTCYGNUS       cd $(srcdir) \
34 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
35 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
36 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
38 .texi.dvi:
39         TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \
40 ## Must set MAKEINFO like this so that version.texi will be found even
41 ## if it is in srcdir.
42           MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
44 .texi:
45 ## We want to force the .info file to be built in srcdir.  This is
46 ## probably the simplest way.  However, at Cygnus .info files are
47 ## always put into the build directory.  So at runtime we select which
48 ## rule to use.
49 ## Note that we also remove the possible output files before running
50 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
51 ## using --no-split), you'll be left with some dead info files lying
52 ## around -- dead files which will end up in the distribution.
53 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
54 NOTCYGNUS       cd $(srcdir) \
55 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
56 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
57 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
59 .texinfo.info:
60 ## We want to force the .info file to be built in srcdir.  This is
61 ## probably the simplest way.  However, at Cygnus .info files are
62 ## always put into the build directory.  So at runtime we select which
63 ## rule to use.
64 ## Note that we also remove the possible output files before running
65 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
66 ## using --no-split), you'll be left with some dead info files lying
67 ## around -- dead files which will end up in the distribution.
68 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
69 NOTCYGNUS       cd $(srcdir) \
70 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
71 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
72 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
74 .texinfo:
75 ## We want to force the .info file to be built in srcdir.  This is
76 ## probably the simplest way.  However, at Cygnus .info files are
77 ## always put into the build directory.  So at runtime we select which
78 ## rule to use.
79 ## Note that we also remove the possible output files before running
80 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
81 ## using --no-split), you'll be left with some dead info files lying
82 ## around -- dead files which will end up in the distribution.
83 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
84 NOTCYGNUS       cd $(srcdir) \
85 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
86 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
87 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
89 .texinfo.dvi:
90         TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \
91 ## Must set MAKEINFO like this so that version.texi will be found even
92 ## if it is in srcdir.
93           MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
95 .txi.info:
96 ## We want to force the .info file to be built in srcdir.  This is
97 ## probably the simplest way.  However, at Cygnus .info files are
98 ## always put into the build directory.  So at runtime we select which
99 ## rule to use.
100 ## Note that we also remove the possible output files before running
101 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
102 ## using --no-split), you'll be left with some dead info files lying
103 ## around -- dead files which will end up in the distribution.
104 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
105 NOTCYGNUS       cd $(srcdir) \
106 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
107 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
108 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
110 .txi.dvi:
111         TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \
112 ## Must set MAKEINFO like this so that version.texi will be found even
113 ## if it is in srcdir.
114           MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
116 .txi:
117 ## We want to force the .info file to be built in srcdir.  This is
118 ## probably the simplest way.  However, at Cygnus .info files are
119 ## always put into the build directory.  So at runtime we select which
120 ## rule to use.
121 ## Note that we also remove the possible output files before running
122 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
123 ## using --no-split), you'll be left with some dead info files lying
124 ## around -- dead files which will end up in the distribution.
125 NOTCYGNUS       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
126 NOTCYGNUS       cd $(srcdir) \
127 NOTCYGNUS         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
128 CYGNUS  @rm -f $@ $@-[0-9] $@-[0-9][0-9]
129 CYGNUS  $(MAKEINFO) -I $(srcdir) $<
131 ## The way to make PostScript, for those who want it.
132 DVIPS = dvips
133 .dvi.ps:
134         $(DVIPS) $< -o $@
136 ## Look in both . and srcdir because the info pages might have been
137 ## rebuilt in the build directory.  Can't cd to srcdir; that might
138 ## break a possible install-sh reference.
139 ## Funny name due to --cygnus influence; we want to reserve
140 ## `install-info' for the user.
141 install-info-am: $(INFO_DEPS)
142         @$(NORMAL_INSTALL)
143         $(mkinstalldirs) $(DESTDIR)$(infodir)
144         @list='$(INFO_DEPS)'; \
145         for file in $$list; do \
146 CYGNUS    if test -f $$file; then d=.; else d=$(srcdir); fi; \
147 NOTCYGNUS         d=$(srcdir); \
148 ## We use these strange circumlocutions because we want the "ifile" to
149 ## be relative, for the install.
150           for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
151             if test -f $$d/$$ifile; then \
152               echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
153               $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
154             else : ; fi; \
155           done; \
156         done
157         @$(POST_INSTALL)
158 ## Only run this code if install-info actually exists, and it is not
159 ## the Debian install-info.  FIXME: once Debian install-info goes
160 ## away, we can remove this hack.
161         @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
162           list='$(INFO_DEPS)'; \
163           for file in $$list; do \
164 ## Run `:' after install-info in case install-info fails.  We really
165 ## don't care about failures here, because they can be spurious.  For
166 ## instance if you don't have a dir file, install-info will fail.  I
167 ## think instead it should create a new dir file for you.  This bug
168 ## causes the `make distcheck' target to fail reliably.
169             echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
170 ## Use `|| :' here because Sun make passes -e to sh; if install-info
171 ## fails then we'd fail if we used `;'.
172             install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
173           done; \
174         else : ; fi
176 uninstall-info:
177         $(PRE_UNINSTALL)
178 ## Run two loops here so that we can handle PRE_UNINSTALL and
179 ## NORMAL_UNINSTALL correctly.
180         @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
181           list='$(INFO_DEPS)'; \
182           for file in $$list; do \
183 ## install-info needs the actual info file.  We use the installed one,
184 ## rather than relying on one still being in srcdir or builddir.
185             echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \
186             install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file; \
187           done; \
188         else :; fi
189         @$(NORMAL_UNINSTALL)
190         @list='$(INFO_DEPS)'; \
191         for file in $$list; do \
192           (if cd $(DESTDIR)$(infodir); then \
193              echo " rm -f $$file $$file-[0-9] $$file-[0-9][0-9])"; \
194              rm -f $$file $$file-[0-9] $$file-[0-9][0-9]; \
195            else :; fi); \
196         done
198 dist-info: $(INFO_DEPS)
199         list='$(INFO_DEPS)'; \
200         for base in $$list; do \
201 ## In Cygnus mode, allow info file to be in source or build dir.  In
202 ## other modes, allow only source dir.
203 NOTCYGNUS         d=$(srcdir); \
204 CYGNUS    if test -f $$base; then d=.; else d=$(srcdir); fi; \
205           for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
206             test -f $(distdir)/$$file \
207             || cp -p $$d/$$file $(distdir)/$$file; \
208           done; \
209         done
211 .PHONY: install-info-am uninstall-info
214 ## How to clean.  The funny name is due to --cygnus influence; in
215 ## Cygnus mode, `clean-info' is a target that users can use.
217 .PHONY: mostlyclean-aminfo
218 mostlyclean-am: mostlyclean-aminfo
219 mostlyclean-aminfo:
220 @TEXICLEAN@
222 .PHONY: maintainer-clean-aminfo
223 maintainer-clean-am: maintainer-clean-aminfo
224 maintainer-clean-aminfo:
225 ## Eww.  But how else can we find all the output files from makeinfo?
226 NOTCYGNUS       cd $(srcdir) && \
227         for i in $(INFO_DEPS); do \
228           rm -f $$i; \
229           if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
230             rm -f $$i-[0-9]*; \
231           fi; \
232         done
234 CYGNUS.PHONY: clean-info
235 CYGNUSclean-info: mostlyclean-aminfo