1 ## automake - create Makefile.in from Makefile.am
3 ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 ## Free Software Foundation, Inc.
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 2, or (at your option)
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.
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software
18 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
31 ## Find these programs wherever they may lie. Yes, this has
32 ## intimate knowledge of the structure of the texinfo distribution.
33 MAKEINFO = `if test -f $(top_builddir)/../texinfo/makeinfo/makeinfo; then \
34 echo $(top_builddir)/../texinfo/makeinfo/makeinfo; \
39 TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then \
40 echo $(top_srcdir)/../texinfo/util/texi2dvi; \
46 TEXI2PDF = $(TEXI2DVI) --pdf --batch
47 MAKEINFOHTML = $(MAKEINFO) --html
48 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
56 ## The way to make PostScript, for those who want it.
63 .PHONY: dvi dvi-am html html-am info info-am pdf pdf-am ps ps-am
65 RECURSIVE_TARGETS += dvi-recursive html-recursive info-recursive
66 RECURSIVE_TARGETS += pdf-recursive ps-recursive
92 endif ! %?LOCAL-TEXIS%
99 ## Look in both . and srcdir because the info pages might have been
100 ## rebuilt in the build directory. Can't cd to srcdir; that might
101 ## break a possible install-sh reference.
103 ## Funny name due to --cygnus influence; we want to reserve
104 ## `install-info' for the user.
106 ## TEXINFOS primary are always installed in infodir, hence install-data
110 am__installdirs += $(DESTDIR)$(infodir)
111 install-data-am: install-info-am
113 endif %?INSTALL-INFO%
116 RECURSIVE_TARGETS += install-info-recursive
117 install-info: install-info-recursive
119 install-info: install-info-am
122 .PHONY: install-info-am
124 install-info-am: $(INFO_DEPS)
126 $(mkdir_p) $(DESTDIR)$(infodir)
127 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
128 list='$(INFO_DEPS)'; \
129 for file in $$list; do \
130 ## Strip possible $(srcdir) prefix.
132 $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
134 if test -f $$file; then d=.; else d=$(srcdir); fi; \
135 ## 8+3 filesystems cannot deal with foo.info-N filenames: they all
136 ## conflict. DJGPP comes with a tool, DJTAR, that will rename these
137 ## files to foo.iNN while extracting the archive. DJGPP's makeinfo
138 ## is patched to grok these filenames. However we have to account
139 ## for the renaming when installing the info files.
141 ## If $file == foo.info, then $file_i == foo.i. The reason we use two
142 ## shell commands instead of one ('s|\.info$$|.i|') is so that a suffix-less
143 ## `foo' becomes `foo.i' too.
144 file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
145 for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
146 $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
147 if test -f $$ifile; then \
149 relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
150 echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \
151 $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \
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. Some versions of Debian install-info
159 ## print their version on stderr (e.g. 1.8.3), other do it in
160 ## on stdout (e.g. 1.10.15).
163 ## install-info --version 2>&1 | sed 1q | grep -v -i debian
164 ## as if install-info does not exist, grep -v will be happy, and
165 ## therefore the code will be triggered although install-info is missing.
166 @if (install-info --version && \
167 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
168 list='$(INFO_DEPS)'; \
169 for file in $$list; do \
171 relfile=`echo "$$file" | sed 's|^.*/||'`; \
172 ## Run `:' after install-info in case install-info fails. We really
173 ## don't care about failures here, because they can be spurious. For
174 ## instance if you don't have a dir file, install-info will fail. I
175 ## think instead it should create a new dir file for you. This bug
176 ## causes the `make distcheck' target to fail reliably.
177 echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\
178 ## Use `|| :' here because Sun make passes -e to sh; if install-info
179 ## fails then we'd fail if we used `;'.
180 install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile || :;\
183 else ! %?LOCAL-TEXIS%
185 endif ! %?LOCAL-TEXIS%
192 ?SUBDIRS?RECURSIVE_TARGETS += uninstall-info-recursive
193 ?SUBDIRS?uninstall-info: uninstall-info-recursive
194 ?INSTALL-INFO?uninstall-am: uninstall-info-am
196 .PHONY: uninstall-info-am
201 ## Run two loops here so that we can handle PRE_UNINSTALL and
202 ## NORMAL_UNINSTALL correctly.
203 @if (install-info --version && \
204 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
205 list='$(INFO_DEPS)'; \
206 for file in $$list; do \
207 relfile=`echo "$$file" | sed 's|^.*/||'`; \
208 ## install-info needs the actual info file. We use the installed one,
209 ## rather than relying on one still being in srcdir or builddir.
210 echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \
211 install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \
215 @list='$(INFO_DEPS)'; \
216 for file in $$list; do \
217 relfile=`echo "$$file" | sed 's|^.*/||'`; \
218 ## DJGPP-style info files. See comment in install-info-am.
219 relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
220 (if cd $(DESTDIR)$(infodir); then \
221 echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \
222 rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
225 else ! %?LOCAL-TEXIS%
227 endif ! %?LOCAL-TEXIS%
231 dist-info: $(INFO_DEPS)
232 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
233 list='$(INFO_DEPS)'; \
234 for base in $$list; do \
235 ## Strip possible $(srcdir) prefix.
237 $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
239 if test -f $$base; then d=.; else d=$(srcdir); fi; \
240 for file in $$d/$$base*; do \
241 ## Strip leading '$$d/'.
242 relfile=`expr "$$file" : "$$d/\(.*\)"`; \
243 test -f $(distdir)/$$relfile || \
244 cp -p $$file $(distdir)/$$relfile; \
254 ## The funny name is due to --cygnus influence; in Cygnus mode,
255 ## `clean-info' is a target that users can use.
258 .PHONY mostlyclean-am: mostlyclean-aminfo
259 .PHONY: mostlyclean-aminfo
261 ## Use `-rf', not just `-f', because %TEXICLEAN% also contains
262 ## any directory created by `makeinfo --html'.
265 .PHONY maintainer-clean-am: maintainer-clean-aminfo
266 maintainer-clean-aminfo:
267 @list='$(INFO_DEPS)'; for i in $$list; do \
268 ## .iNN files are DJGPP-style info files.
269 i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
270 echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
271 rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
274 ?CYGNUS?.PHONY: clean-info
275 ?CYGNUS?clean-info: mostlyclean-aminfo