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
54 ## The way to make PostScript, for those who want it.
61 .PHONY: info info-am dvi dvi-am pdf pdf-am
63 RECURSIVE_TARGETS += info-recursive dvi-recursive pdf-recursive ps-recursive
64 .PHONY info: info-recursive
65 .PHONY dvi: dvi-recursive
66 .PHONY pdf: pdf-recursive
67 .PHONY ps: ps-recursive
85 endif ! %?LOCAL-TEXIS%
92 ## Look in both . and srcdir because the info pages might have been
93 ## rebuilt in the build directory. Can't cd to srcdir; that might
94 ## break a possible install-sh reference.
96 ## Funny name due to --cygnus influence; we want to reserve
97 ## `install-info' for the user.
99 ## TEXINFOS primary are always installed in infodir, hence install-data
103 am__installdirs += $(DESTDIR)$(infodir)
104 install-data-am: install-info-am
107 RECURSIVE_TARGETS += install-info-recursive
108 .PHONY install-info: install-info-recursive
110 install-info: install-info-am
112 endif %?INSTALL-INFO%
114 .PHONY: install-info-am
117 install-info-am: $(INFO_DEPS)
119 $(mkinstalldirs) $(DESTDIR)$(infodir)
120 @list='$(INFO_DEPS)'; \
121 for file in $$list; do \
122 if test -f $$file; then d=.; else d=$(srcdir); fi; \
123 ## 8+3 filesystems cannot deal with foo.info-N filenames: they all
124 ## conflict. DJGPP comes with a tool, DJTAR, that will rename these
125 ## files to foo.iNN while extracting the archive. DJGPP's makeinfo
126 ## is patched to grok these filenames. However we have to account
127 ## for the renaming when installing the info files.
129 ## If $file == foo.info, then $file_i == foo.i. The reason we use two
130 ## shell commands instead of one ('s|\.info$$|.i|') is so that a suffix-less
131 ## `foo' becomes `foo.i' too.
132 file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
133 for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
134 $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
135 if test -f $$ifile; then \
137 relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
138 echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \
139 $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \
144 ## Only run this code if install-info actually exists, and it is not
145 ## the Debian install-info. FIXME: once Debian install-info goes
146 ## away, we can remove this hack. Debian install-info v1.8.3
147 ## prints version info to stderr.
150 ## install-info --version 2>&1 | sed 1q | grep -s -v -i debian
151 ## as if install-info does not exist, grep -v will be happy, and
152 ## therefore the code will be triggered although install-info is missing.
153 @if (install-info --version && \
154 install-info --version | grep -i -v debian) >/dev/null 2>&1; then \
155 list='$(INFO_DEPS)'; \
156 for file in $$list; do \
158 relfile=`echo "$$file" | sed 's|^.*/||'`; \
159 ## Run `:' after install-info in case install-info fails. We really
160 ## don't care about failures here, because they can be spurious. For
161 ## instance if you don't have a dir file, install-info will fail. I
162 ## think instead it should create a new dir file for you. This bug
163 ## causes the `make distcheck' target to fail reliably.
164 echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\
165 ## Use `|| :' here because Sun make passes -e to sh; if install-info
166 ## fails then we'd fail if we used `;'.
167 install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile || :;\
170 else ! %?LOCAL-TEXIS%
172 endif ! %?LOCAL-TEXIS%
179 ?SUBDIRS?RECURSIVE_TARGETS += uninstall-info-recursive
180 ?SUBDIRS?.PHONY uninstall-info: uninstall-info-recursive
181 ?INSTALL-INFO?uninstall-am: uninstall-info-am
183 .PHONY: uninstall-info-am
188 ## Run two loops here so that we can handle PRE_UNINSTALL and
189 ## NORMAL_UNINSTALL correctly. Debian install-info v1.8.3 prints
190 ## version info to stderr.
191 @if (install-info --version && \
192 install-info --version | grep -i -v debian) >/dev/null 2>&1; then \
193 list='$(INFO_DEPS)'; \
194 for file in $$list; do \
195 relfile=`echo "$$file" | sed 's|^.*/||'`; \
196 ## install-info needs the actual info file. We use the installed one,
197 ## rather than relying on one still being in srcdir or builddir.
198 echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \
199 install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \
203 @list='$(INFO_DEPS)'; \
204 for file in $$list; do \
205 relfile=`echo "$$file" | sed 's|^.*/||'`; \
206 ## DJGPP-style info files. See comment in install-info-am.
207 relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
208 (if cd $(DESTDIR)$(infodir); then \
209 echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \
210 rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
213 else ! %?LOCAL-TEXIS%
215 endif ! %?LOCAL-TEXIS%
219 dist-info: $(INFO_DEPS)
220 list='$(INFO_DEPS)'; \
221 for base in $$list; do \
222 if test -f $$base; then d=.; else d=$(srcdir); fi; \
223 for file in $$d/$$base*; do \
224 ## Strip leading '$$d/'.
225 relfile=`expr "$$file" : "$$d/\(.*\)"`; \
226 test -f $(distdir)/$$relfile || \
227 cp -p $$file $(distdir)/$$relfile; \
237 ## The funny name is due to --cygnus influence; in Cygnus mode,
238 ## `clean-info' is a target that users can use.
241 .PHONY: mostlyclean-aminfo
242 mostlyclean-am: mostlyclean-aminfo
246 .PHONY: maintainer-clean-aminfo
247 maintainer-clean-am: maintainer-clean-aminfo
248 maintainer-clean-aminfo:
249 @list='$(INFO_DEPS)'; for i in $$list; do \
250 ## .iNN files are DJGPP-style info files.
251 i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
252 echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
253 rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
256 ?CYGNUS?.PHONY: clean-info
257 ?CYGNUS?clean-info: mostlyclean-aminfo