Reword the copyright notices to match what's suggested in GPLv3.
[automake/plouj.git] / lib / am / texinfos.am
blob8bf594c957e6734c4f2d9a799c26fa23e0770d7d
1 ## automake - create Makefile.in from Makefile.am
3 ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 ## 2003, 2004, 2005, 2006, 2007 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 3, or (at your option)
9 ## any later version.
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, see <http://www.gnu.org/licenses/>.
19 ## ----------- ##
20 ## Variables.  ##
21 ## ----------- ##
23 if %?LOCAL-TEXIS%
24 if ! %?CYGNUS%
25 TEXI2DVI = texi2dvi
27 else %?CYGNUS%
29 ## Find these programs wherever they may lie.  Yes, this has
30 ## intimate knowledge of the structure of the texinfo distribution.
31 MAKEINFO = `if test -f $(top_builddir)/../texinfo/makeinfo/makeinfo; then \
32             echo $(top_builddir)/../texinfo/makeinfo/makeinfo; \
33           else \
34             echo makeinfo; \
35           fi`
37 TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then \
38              echo $(top_srcdir)/../texinfo/util/texi2dvi; \
39            else \
40              echo texi2dvi; \
41            fi`
42 endif %?CYGNUS%
44 TEXI2PDF = $(TEXI2DVI) --pdf --batch
45 MAKEINFOHTML = $(MAKEINFO) --html
46 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
47 endif %?LOCAL-TEXIS%
50 ## ---------- ##
51 ## Building.  ##
52 ## ---------- ##
54 ## The way to make PostScript, for those who want it.
55 if %?LOCAL-TEXIS%
56 DVIPS = dvips
57 .dvi.ps:
58         TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
59         $(DVIPS) -o $@ $<
60 endif %?LOCAL-TEXIS%
62 .PHONY: dvi dvi-am html html-am info info-am pdf pdf-am ps ps-am
63 if %?SUBDIRS%
64 RECURSIVE_TARGETS += dvi-recursive html-recursive info-recursive
65 RECURSIVE_TARGETS += pdf-recursive ps-recursive
66 dvi: dvi-recursive
67 html: html-recursive
68 info: info-recursive
69 pdf: pdf-recursive
70 ps: ps-recursive
71 else !%?SUBDIRS%
72 dvi: dvi-am
73 html: html-am
74 info: info-am
75 pdf: pdf-am
76 ps: ps-am
77 endif !%?SUBDIRS%
79 if %?LOCAL-TEXIS%
80 dvi-am: $(DVIS)
81 html-am: $(HTMLS)
82 info-am: $(INFO_DEPS)
83 pdf-am: $(PDFS)
84 ps-am: $(PSS)
85 else ! %?LOCAL-TEXIS%
86 dvi-am:
87 html-am:
88 info-am:
89 pdf-am:
90 ps-am:
91 endif ! %?LOCAL-TEXIS%
94 ## ------------ ##
95 ## Installing.  ##
96 ## ------------ ##
98 ## Look in both . and srcdir because the info pages might have been
99 ## rebuilt in the build directory.  Can't cd to srcdir; that might
100 ## break a possible install-sh reference.
102 ## Funny name due to --cygnus influence; we want to reserve
103 ## `install-info' for the user.
105 ## TEXINFOS primary are always installed in infodir, hence install-data
106 ## is hard coded.
107 if %?INSTALL-INFO%
108 if %?LOCAL-TEXIS%
109 am__installdirs += "$(DESTDIR)$(infodir)"
110 install-data-am: install-info-am
111 endif %?LOCAL-TEXIS%
112 endif %?INSTALL-INFO%
113 .PHONY: \
114   install-dvi  install-dvi-am \
115   install-html install-html-am \
116   install-info install-info-am \
117   install-pdf  install-pdf-am \
118   install-ps   install-ps-am
120 if %?SUBDIRS%
121 RECURSIVE_TARGETS += \
122   install-dvi-recursive \
123   install-html-recursive \
124   install-info-recursive \
125   install-pdf-recursive \
126   install-ps-recursive
127 install-dvi: install-dvi-recursive
128 install-html: install-html-recursive
129 install-info: install-info-recursive
130 install-pdf: install-pdf-recursive
131 install-ps: install-ps-recursive
132 else !%?SUBDIRS%
133 install-dvi: install-dvi-am
134 install-html: install-html-am
135 install-info: install-info-am
136 install-pdf: install-pdf-am
137 install-ps: install-ps-am
138 endif !%?SUBDIRS%
140 if %?LOCAL-TEXIS%
142 include inst-vars.am
144 install-dvi-am: $(DVIS)
145         @$(NORMAL_INSTALL)
146         test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)"
147         @list='$(DVIS)'; for p in $$list; do \
148           if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
149           $(am__strip_dir) \
150           echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/$$f'"; \
151           $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/$$f"; \
152         done
154 install-html-am: $(HTMLS)
155         @$(NORMAL_INSTALL)
156         test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
157         @list='$(HTMLS)'; for p in $$list; do \
158           if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
159           $(am__strip_dir) \
160           if test -d "$$d$$p"; then \
161             echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
162             $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
163             echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
164             $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
165           else \
166             echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
167             $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
168           fi; \
169         done
171 install-info-am: $(INFO_DEPS)
172         @$(NORMAL_INSTALL)
173         test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)"
174         @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
175         list='$(INFO_DEPS)'; \
176         for file in $$list; do \
177 ## Strip possible $(srcdir) prefix.
178           case $$file in \
179             $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
180           esac; \
181           if test -f $$file; then d=.; else d=$(srcdir); fi; \
182 ## 8+3 filesystems cannot deal with foo.info-N filenames: they all
183 ## conflict.  DJGPP comes with a tool, DJTAR, that will rename these
184 ## files to foo.iNN while extracting the archive.  DJGPP's makeinfo
185 ## is patched to grok these filenames.  However we have to account
186 ## for the renaming when installing the info files.
188 ## If $file == foo.info, then $file_i == foo.i.  The reason we use two
189 ## shell commands instead of one ('s|\.info$$|.i|') is so that a suffix-less
190 ## `foo' becomes `foo.i' too.
191           file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
192           for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
193                        $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
194             if test -f $$ifile; then \
195 ## Strip directory
196               relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
197               echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
198               $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
199             else : ; fi; \
200           done; \
201         done
202         @$(POST_INSTALL)
203 ## Only run this code if install-info actually exists, and it is not
204 ## the Debian install-info.  FIXME: once Debian install-info goes
205 ## away, we can remove this hack.  Some versions of Debian install-info
206 ## print their version on stderr (e.g. 1.8.3), other do it in
207 ## on stdout (e.g. 1.10.15).
209 ## Do not use
210 ##    install-info --version 2>&1 | sed 1q | grep -v -i debian
211 ## as if install-info does not exist, grep -v will be happy, and
212 ## therefore the code will be triggered although install-info is missing.
213         @if (install-info --version && \
214              install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
215           list='$(INFO_DEPS)'; \
216           for file in $$list; do \
217 ## Strip directory
218             relfile=`echo "$$file" | sed 's|^.*/||'`; \
219 ## Run `:' after install-info in case install-info fails.  We really
220 ## don't care about failures here, because they can be spurious.  For
221 ## instance if you don't have a dir file, install-info will fail.  I
222 ## think instead it should create a new dir file for you.  This bug
223 ## causes the `make distcheck' target to fail reliably.
224             echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
225 ## Use `|| :' here because Sun make passes -e to sh; if install-info
226 ## fails then we'd fail if we used `;'.
227             install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
228           done; \
229         else : ; fi
231 install-pdf-am: $(PDFS)
232         @$(NORMAL_INSTALL)
233         test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
234         @list='$(PDFS)'; for p in $$list; do \
235           if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
236           $(am__strip_dir) \
237           echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \
238           $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \
239         done
241 install-ps-am: $(PSS)
242         @$(NORMAL_INSTALL)
243         test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)"
244         @list='$(PSS)'; for p in $$list; do \
245           if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
246           $(am__strip_dir) \
247           echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(psdir)/$$f'"; \
248           $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(psdir)/$$f"; \
249         done
251 else ! %?LOCAL-TEXIS%
252 install-dvi-am:
253 install-html-am:
254 install-info-am:
255 install-pdf-am:
256 install-ps-am:
257 endif ! %?LOCAL-TEXIS%
260 ## -------------- ##
261 ## Uninstalling.  ##
262 ## -------------- ##
264 if %?LOCAL-TEXIS%
265 .PHONY uninstall-am: \
266   uninstall-dvi-am \
267   uninstall-html-am \
268   uninstall-info-am \
269   uninstall-ps-am \
270   uninstall-pdf-am
272 uninstall-dvi-am:
273         @$(NORMAL_UNINSTALL)
274         @list='$(DVIS)'; for p in $$list; do \
275           $(am__strip_dir) \
276           echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
277           rm -f "$(DESTDIR)$(dvidir)/$$f"; \
278         done
280 uninstall-html-am:
281         @$(NORMAL_UNINSTALL)
282         @list='$(HTMLS)'; for p in $$list; do \
283           $(am__strip_dir) \
284 ## $f can be a directory, hence the -r.
285           echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
286           rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
287         done
289 uninstall-info-am:
290         @$(PRE_UNINSTALL)
291 ## Run two loops here so that we can handle PRE_UNINSTALL and
292 ## NORMAL_UNINSTALL correctly.
293         @if test -d '$(DESTDIR)$(infodir)' && \
294             (install-info --version && \
295              install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
296           list='$(INFO_DEPS)'; \
297           for file in $$list; do \
298             relfile=`echo "$$file" | sed 's|^.*/||'`; \
299 ## install-info needs the actual info file.  We use the installed one,
300 ## rather than relying on one still being in srcdir or builddir.
301             echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
302             install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
303           done; \
304         else :; fi
305         @$(NORMAL_UNINSTALL)
306         @list='$(INFO_DEPS)'; \
307         for file in $$list; do \
308           relfile=`echo "$$file" | sed 's|^.*/||'`; \
309 ## DJGPP-style info files.  See comment in install-info-am.
310           relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
311           (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
312              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]"; \
313              rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
314            else :; fi); \
315         done
317 uninstall-pdf-am:
318         @$(NORMAL_UNINSTALL)
319         @list='$(PDFS)'; for p in $$list; do \
320           $(am__strip_dir) \
321           echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
322           rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
323         done
325 uninstall-ps-am:
326         @$(NORMAL_UNINSTALL)
327         @list='$(PSS)'; for p in $$list; do \
328           $(am__strip_dir) \
329           echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
330           rm -f "$(DESTDIR)$(psdir)/$$f"; \
331         done
332 endif %?LOCAL-TEXIS%
334 if %?LOCAL-TEXIS%
335 .PHONY: dist-info
336 dist-info: $(INFO_DEPS)
337         @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
338         list='$(INFO_DEPS)'; \
339         for base in $$list; do \
340 ## Strip possible $(srcdir) prefix.
341           case $$base in \
342             $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
343           esac; \
344           if test -f $$base; then d=.; else d=$(srcdir); fi; \
345           base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
346           for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
347             if test -f $$file; then \
348 ## Strip leading '$$d/'.
349               relfile=`expr "$$file" : "$$d/\(.*\)"`; \
350               test -f "$(distdir)/$$relfile" || \
351                 cp -p $$file "$(distdir)/$$relfile"; \
352             else :; fi; \
353           done; \
354         done
355 endif %?LOCAL-TEXIS%
358 ## ---------- ##
359 ## Cleaning.  ##
360 ## ---------- ##
362 ## The funny name is due to --cygnus influence; in Cygnus mode,
363 ## `clean-info' is a target that users can use.
365 if %?LOCAL-TEXIS%
366 .PHONY mostlyclean-am: mostlyclean-aminfo
367 .PHONY: mostlyclean-aminfo
368 mostlyclean-aminfo:
369 ## Use `-rf', not just `-f', because %TEXICLEAN% also contains
370 ## any directory created by `makeinfo --html'.
371         -rm -rf %TEXICLEAN%
373 .PHONY maintainer-clean-am: maintainer-clean-aminfo
374 maintainer-clean-aminfo:
375         @list='$(INFO_DEPS)'; for i in $$list; do \
376 ## .iNN files are DJGPP-style info files.
377           i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
378           echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
379           rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
380         done
382 ?CYGNUS?.PHONY: clean-info
383 ?CYGNUS?clean-info: mostlyclean-aminfo
384 endif %?LOCAL-TEXIS%