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
115 RECURSIVE_TARGETS += install-info-recursive
116 install-info: install-info-recursive
118 install-info: install-info-am
120 endif %?INSTALL-INFO%
122 .PHONY: install-info-am
124 install-info-am: $(INFO_DEPS)
126 $(mkdir_p) $(DESTDIR)$(infodir)
127 @list='$(INFO_DEPS)'; \
128 for file in $$list; do \
129 if test -f $$file; then d=.; else d=$(srcdir); fi; \
130 ## 8+3 filesystems cannot deal with foo.info-N filenames: they all
131 ## conflict. DJGPP comes with a tool, DJTAR, that will rename these
132 ## files to foo.iNN while extracting the archive. DJGPP's makeinfo
133 ## is patched to grok these filenames. However we have to account
134 ## for the renaming when installing the info files.
136 ## If $file == foo.info, then $file_i == foo.i. The reason we use two
137 ## shell commands instead of one ('s|\.info$$|.i|') is so that a suffix-less
138 ## `foo' becomes `foo.i' too.
139 file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
140 for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
141 $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
142 if test -f $$ifile; then \
144 relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
145 echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \
146 $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \
151 ## Only run this code if install-info actually exists, and it is not
152 ## the Debian install-info. FIXME: once Debian install-info goes
153 ## away, we can remove this hack. Some versions of Debian install-info
154 ## print their version on stderr (e.g. 1.8.3), other do it in
155 ## on stdout (e.g. 1.10.15).
158 ## install-info --version 2>&1 | sed 1q | grep -v -i debian
159 ## as if install-info does not exist, grep -v will be happy, and
160 ## therefore the code will be triggered although install-info is missing.
161 @if (install-info --version && \
162 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
163 list='$(INFO_DEPS)'; \
164 for file in $$list; do \
166 relfile=`echo "$$file" | sed 's|^.*/||'`; \
167 ## Run `:' after install-info in case install-info fails. We really
168 ## don't care about failures here, because they can be spurious. For
169 ## instance if you don't have a dir file, install-info will fail. I
170 ## think instead it should create a new dir file for you. This bug
171 ## causes the `make distcheck' target to fail reliably.
172 echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\
173 ## Use `|| :' here because Sun make passes -e to sh; if install-info
174 ## fails then we'd fail if we used `;'.
175 install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile || :;\
178 else ! %?LOCAL-TEXIS%
180 endif ! %?LOCAL-TEXIS%
187 ?SUBDIRS?RECURSIVE_TARGETS += uninstall-info-recursive
188 ?SUBDIRS?uninstall-info: uninstall-info-recursive
189 ?INSTALL-INFO?uninstall-am: uninstall-info-am
191 .PHONY: uninstall-info-am
196 ## Run two loops here so that we can handle PRE_UNINSTALL and
197 ## NORMAL_UNINSTALL correctly.
198 @if (install-info --version && \
199 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
200 list='$(INFO_DEPS)'; \
201 for file in $$list; do \
202 relfile=`echo "$$file" | sed 's|^.*/||'`; \
203 ## install-info needs the actual info file. We use the installed one,
204 ## rather than relying on one still being in srcdir or builddir.
205 echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \
206 install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \
210 @list='$(INFO_DEPS)'; \
211 for file in $$list; do \
212 relfile=`echo "$$file" | sed 's|^.*/||'`; \
213 ## DJGPP-style info files. See comment in install-info-am.
214 relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
215 (if cd $(DESTDIR)$(infodir); then \
216 echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \
217 rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
220 else ! %?LOCAL-TEXIS%
222 endif ! %?LOCAL-TEXIS%
226 dist-info: $(INFO_DEPS)
227 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
228 list='$(INFO_DEPS)'; \
229 for base in $$list; do \
231 $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
233 if test -f $$base; then d=.; else d=$(srcdir); fi; \
234 for file in $$d/$$base*; do \
235 ## Strip leading '$$d/'.
236 relfile=`expr "$$file" : "$$d/\(.*\)"`; \
237 test -f $(distdir)/$$relfile || \
238 cp -p $$file $(distdir)/$$relfile; \
248 ## The funny name is due to --cygnus influence; in Cygnus mode,
249 ## `clean-info' is a target that users can use.
252 .PHONY mostlyclean-am: mostlyclean-aminfo
253 .PHONY: mostlyclean-aminfo
255 ## Use `-rf', not just `-f', because %TEXICLEAN% also contains
256 ## any directory created by `makeinfo --html'.
259 .PHONY maintainer-clean-am: maintainer-clean-aminfo
260 maintainer-clean-aminfo:
261 @list='$(INFO_DEPS)'; for i in $$list; do \
262 ## .iNN files are DJGPP-style info files.
263 i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
264 echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
265 rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
268 ?CYGNUS?.PHONY: clean-info
269 ?CYGNUS?clean-info: mostlyclean-aminfo