1 ## automake - create Makefile.in from Makefile.am
3 ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 ## 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, 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.
60 TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
64 .PHONY: dvi dvi-am html html-am info info-am pdf pdf-am ps ps-am
66 RECURSIVE_TARGETS += dvi-recursive html-recursive info-recursive
67 RECURSIVE_TARGETS += pdf-recursive ps-recursive
93 endif ! %?LOCAL-TEXIS%
100 ## Look in both . and srcdir because the info pages might have been
101 ## rebuilt in the build directory. Can't cd to srcdir; that might
102 ## break a possible install-sh reference.
104 ## Funny name due to --cygnus influence; we want to reserve
105 ## `install-info' for the user.
107 ## TEXINFOS primary are always installed in infodir, hence install-data
111 am__installdirs += "$(DESTDIR)$(infodir)"
112 install-data-am: install-info-am
114 endif %?INSTALL-INFO%
116 install-dvi install-dvi-am \
117 install-html install-html-am \
118 install-info install-info-am \
119 install-pdf install-pdf-am \
120 install-ps install-ps-am
123 RECURSIVE_TARGETS += \
124 install-dvi-recursive \
125 install-html-recursive \
126 install-info-recursive \
127 install-pdf-recursive \
129 install-dvi: install-dvi-recursive
130 install-html: install-html-recursive
131 install-info: install-info-recursive
132 install-pdf: install-pdf-recursive
133 install-ps: install-ps-recursive
135 install-dvi: install-dvi-am
136 install-html: install-html-am
137 install-info: install-info-am
138 install-pdf: install-pdf-am
139 install-ps: install-ps-am
146 install-dvi-am: $(DVIS)
148 test -z "$(dvidir)" || $(mkdir_p) "$(DESTDIR)$(dvidir)"
149 @list='$(DVIS)'; for p in $$list; do \
150 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
152 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/$$f'"; \
153 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/$$f"; \
156 install-html-am: $(HTMLS)
158 test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
159 @list='$(HTMLS)'; for p in $$list; do \
160 if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
162 if test -d "$$d$$p"; then \
163 echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
164 $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
165 echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
166 $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
168 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
169 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
173 install-info-am: $(INFO_DEPS)
175 test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
176 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
177 list='$(INFO_DEPS)'; \
178 for file in $$list; do \
179 ## Strip possible $(srcdir) prefix.
181 $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
183 if test -f $$file; then d=.; else d=$(srcdir); fi; \
184 ## 8+3 filesystems cannot deal with foo.info-N filenames: they all
185 ## conflict. DJGPP comes with a tool, DJTAR, that will rename these
186 ## files to foo.iNN while extracting the archive. DJGPP's makeinfo
187 ## is patched to grok these filenames. However we have to account
188 ## for the renaming when installing the info files.
190 ## If $file == foo.info, then $file_i == foo.i. The reason we use two
191 ## shell commands instead of one ('s|\.info$$|.i|') is so that a suffix-less
192 ## `foo' becomes `foo.i' too.
193 file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
194 for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
195 $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
196 if test -f $$ifile; then \
198 relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
199 echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
200 $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
205 ## Only run this code if install-info actually exists, and it is not
206 ## the Debian install-info. FIXME: once Debian install-info goes
207 ## away, we can remove this hack. Some versions of Debian install-info
208 ## print their version on stderr (e.g. 1.8.3), other do it in
209 ## on stdout (e.g. 1.10.15).
212 ## install-info --version 2>&1 | sed 1q | grep -v -i debian
213 ## as if install-info does not exist, grep -v will be happy, and
214 ## therefore the code will be triggered although install-info is missing.
215 @if (install-info --version && \
216 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
217 list='$(INFO_DEPS)'; \
218 for file in $$list; do \
220 relfile=`echo "$$file" | sed 's|^.*/||'`; \
221 ## Run `:' after install-info in case install-info fails. We really
222 ## don't care about failures here, because they can be spurious. For
223 ## instance if you don't have a dir file, install-info will fail. I
224 ## think instead it should create a new dir file for you. This bug
225 ## causes the `make distcheck' target to fail reliably.
226 echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
227 ## Use `|| :' here because Sun make passes -e to sh; if install-info
228 ## fails then we'd fail if we used `;'.
229 install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
233 install-pdf-am: $(PDFS)
235 test -z "$(pdfdir)" || $(mkdir_p) "$(DESTDIR)$(pdfdir)"
236 @list='$(PDFS)'; for p in $$list; do \
237 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
239 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \
240 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \
243 install-ps-am: $(PSS)
245 test -z "$(psdir)" || $(mkdir_p) "$(DESTDIR)$(psdir)"
246 @list='$(PSS)'; for p in $$list; do \
247 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
249 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(psdir)/$$f'"; \
250 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(psdir)/$$f"; \
253 else ! %?LOCAL-TEXIS%
259 endif ! %?LOCAL-TEXIS%
267 .PHONY uninstall-am: \
276 @list='$(DVIS)'; for p in $$list; do \
278 echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
279 rm -f "$(DESTDIR)$(dvidir)/$$f"; \
284 @list='$(HTMLS)'; for p in $$list; do \
286 ## $f can be a directory, hence the -r.
287 echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
288 rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
293 ## Run two loops here so that we can handle PRE_UNINSTALL and
294 ## NORMAL_UNINSTALL correctly.
295 @if test -d '$(DESTDIR)$(infodir)' && \
296 (install-info --version && \
297 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
298 list='$(INFO_DEPS)'; \
299 for file in $$list; do \
300 relfile=`echo "$$file" | sed 's|^.*/||'`; \
301 ## install-info needs the actual info file. We use the installed one,
302 ## rather than relying on one still being in srcdir or builddir.
303 echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
304 install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
308 @list='$(INFO_DEPS)'; \
309 for file in $$list; do \
310 relfile=`echo "$$file" | sed 's|^.*/||'`; \
311 ## DJGPP-style info files. See comment in install-info-am.
312 relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
313 (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
314 echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
315 rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
321 @list='$(PDFS)'; for p in $$list; do \
323 echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
324 rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
329 @list='$(PSS)'; for p in $$list; do \
331 echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
332 rm -f "$(DESTDIR)$(psdir)/$$f"; \
338 dist-info: $(INFO_DEPS)
339 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
340 list='$(INFO_DEPS)'; \
341 for base in $$list; do \
342 ## Strip possible $(srcdir) prefix.
344 $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
346 if test -f $$base; then d=.; else d=$(srcdir); fi; \
347 for file in $$d/$$base*; do \
348 ## Strip leading '$$d/'.
349 relfile=`expr "$$file" : "$$d/\(.*\)"`; \
350 test -f $(distdir)/$$relfile || \
351 cp -p $$file $(distdir)/$$relfile; \
361 ## The funny name is due to --cygnus influence; in Cygnus mode,
362 ## `clean-info' is a target that users can use.
365 .PHONY mostlyclean-am: mostlyclean-aminfo
366 .PHONY: mostlyclean-aminfo
368 ## Use `-rf', not just `-f', because %TEXICLEAN% also contains
369 ## any directory created by `makeinfo --html'.
372 .PHONY maintainer-clean-am: maintainer-clean-aminfo
373 maintainer-clean-aminfo:
374 @list='$(INFO_DEPS)'; for i in $$list; do \
375 ## .iNN files are DJGPP-style info files.
376 i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
377 echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
378 rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
381 ?CYGNUS?.PHONY: clean-info
382 ?CYGNUS?clean-info: mostlyclean-aminfo