source: trunk/essentials/sys-devel/automake-1.7/lib/am/texinfos.am

Last change on this file was 3120, checked in by bird, 18 years ago

automake 1.7.9

File size: 8.3 KB
Line 
1## automake - create Makefile.in from Makefile.am
2
3## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4## Free Software Foundation, Inc.
5
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)
9## any later version.
10
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.
15
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
19## 02111-1307, USA.
20
21## ----------- ##
22## Variables. ##
23## ----------- ##
24
25if %?LOCAL-TEXIS%
26if ! %?CYGNUS%
27MAKEINFO = @MAKEINFO@
28TEXI2DVI = texi2dvi
29
30else %?CYGNUS%
31
32## Find these programs wherever they may lie. Yes, this has
33## intimate knowledge of the structure of the texinfo distribution.
34MAKEINFO = `if test -f $(top_builddir)/../texinfo/makeinfo/makeinfo; then \
35 echo $(top_builddir)/../texinfo/makeinfo/makeinfo; \
36 else \
37 echo makeinfo; \
38 fi`
39
40TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then \
41 echo $(top_srcdir)/../texinfo/util/texi2dvi; \
42 else \
43 echo texi2dvi; \
44 fi`
45endif %?CYGNUS%
46
47TEXI2PDF = $(TEXI2DVI) --pdf --batch
48endif %?LOCAL-TEXIS%
49
50
51## ---------- ##
52## Building. ##
53## ---------- ##
54
55## The way to make PostScript, for those who want it.
56if %?LOCAL-TEXIS%
57DVIPS = dvips
58.dvi.ps:
59 $(DVIPS) -o $@ $<
60endif %?LOCAL-TEXIS%
61
62.PHONY: info info-am dvi dvi-am pdf pdf-am
63if %?SUBDIRS%
64RECURSIVE_TARGETS += info-recursive dvi-recursive pdf-recursive ps-recursive
65.PHONY info: info-recursive
66.PHONY dvi: dvi-recursive
67.PHONY pdf: pdf-recursive
68.PHONY ps: ps-recursive
69else !%?SUBDIRS%
70info: info-am
71dvi: dvi-am
72pdf: pdf-am
73ps: ps-am
74endif !%?SUBDIRS%
75
76if %?LOCAL-TEXIS%
77info-am: $(INFO_DEPS)
78dvi-am: $(DVIS)
79pdf-am: $(PDFS)
80ps-am: $(PSS)
81else ! %?LOCAL-TEXIS%
82info-am:
83dvi-am:
84pdf-am:
85ps-am:
86endif ! %?LOCAL-TEXIS%
87
88
89## ------------ ##
90## Installing. ##
91## ------------ ##
92
93## Look in both . and srcdir because the info pages might have been
94## rebuilt in the build directory. Can't cd to srcdir; that might
95## break a possible install-sh reference.
96##
97## Funny name due to --cygnus influence; we want to reserve
98## `install-info' for the user.
99##
100## TEXINFOS primary are always installed in infodir, hence install-data
101## is hard coded.
102if %?INSTALL-INFO%
103if %?LOCAL-TEXIS%
104am__installdirs += $(DESTDIR)$(infodir)
105install-data-am: install-info-am
106endif %?LOCAL-TEXIS%
107if %?SUBDIRS%
108RECURSIVE_TARGETS += install-info-recursive
109.PHONY install-info: install-info-recursive
110else !%?SUBDIRS%
111install-info: install-info-am
112endif !%?SUBDIRS%
113endif %?INSTALL-INFO%
114
115.PHONY: install-info-am
116
117if %?LOCAL-TEXIS%
118install-info-am: $(INFO_DEPS)
119 @$(NORMAL_INSTALL)
120 $(mkinstalldirs) $(DESTDIR)$(infodir)
121 @list='$(INFO_DEPS)'; \
122 for file in $$list; do \
123 if test -f $$file; then d=.; else d=$(srcdir); fi; \
124## 8+3 filesystems cannot deal with foo.info-N filenames: they all
125## conflict. DJGPP comes with a tool, DJTAR, that will rename these
126## files to foo.iNN while extracting the archive. DJGPP's makeinfo
127## is patched to grok these filenames. However we have to account
128## for the renaming when installing the info files.
129##
130## If $file == foo.info, then $file_i == foo.i. The reason we use two
131## shell commands instead of one ('s|\.info$$|.i|') is so that a suffix-less
132## `foo' becomes `foo.i' too.
133 file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
134 for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
135 $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
136 if test -f $$ifile; then \
137## Strip directory
138 relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
139 echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \
140 $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \
141 else : ; fi; \
142 done; \
143 done
144 @$(POST_INSTALL)
145## Only run this code if install-info actually exists, and it is not
146## the Debian install-info. FIXME: once Debian install-info goes
147## away, we can remove this hack. Some versions of Debian install-info
148## print their version on stderr (e.g. 1.8.3), other do it in
149## on stdout (e.g. 1.10.15).
150##
151## Do not use
152## install-info --version 2>&1 | sed 1q | grep -v -i debian
153## as if install-info does not exist, grep -v will be happy, and
154## therefore the code will be triggered although install-info is missing.
155 @if (install-info --version && \
156 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
157 list='$(INFO_DEPS)'; \
158 for file in $$list; do \
159## Strip directory
160 relfile=`echo "$$file" | sed 's|^.*/||'`; \
161## Run `:' after install-info in case install-info fails. We really
162## don't care about failures here, because they can be spurious. For
163## instance if you don't have a dir file, install-info will fail. I
164## think instead it should create a new dir file for you. This bug
165## causes the `make distcheck' target to fail reliably.
166 echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\
167## Use `|| :' here because Sun make passes -e to sh; if install-info
168## fails then we'd fail if we used `;'.
169 install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile || :;\
170 done; \
171 else : ; fi
172else ! %?LOCAL-TEXIS%
173install-info-am:
174endif ! %?LOCAL-TEXIS%
175
176
177## -------------- ##
178## Uninstalling. ##
179## -------------- ##
180
181?SUBDIRS?RECURSIVE_TARGETS += uninstall-info-recursive
182?SUBDIRS?.PHONY uninstall-info: uninstall-info-recursive
183?INSTALL-INFO?uninstall-am: uninstall-info-am
184
185.PHONY: uninstall-info-am
186
187if %?LOCAL-TEXIS%
188uninstall-info-am:
189 $(PRE_UNINSTALL)
190## Run two loops here so that we can handle PRE_UNINSTALL and
191## NORMAL_UNINSTALL correctly.
192 @if (install-info --version && \
193 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
194 list='$(INFO_DEPS)'; \
195 for file in $$list; do \
196 relfile=`echo "$$file" | sed 's|^.*/||'`; \
197## install-info needs the actual info file. We use the installed one,
198## rather than relying on one still being in srcdir or builddir.
199 echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \
200 install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \
201 done; \
202 else :; fi
203 @$(NORMAL_UNINSTALL)
204 @list='$(INFO_DEPS)'; \
205 for file in $$list; do \
206 relfile=`echo "$$file" | sed 's|^.*/||'`; \
207## DJGPP-style info files. See comment in install-info-am.
208 relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
209 (if cd $(DESTDIR)$(infodir); then \
210 echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \
211 rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
212 else :; fi); \
213 done
214else ! %?LOCAL-TEXIS%
215uninstall-info-am:
216endif ! %?LOCAL-TEXIS%
217
218if %?LOCAL-TEXIS%
219.PHONY: dist-info
220dist-info: $(INFO_DEPS)
221 list='$(INFO_DEPS)'; \
222 for base in $$list; do \
223 if test -f $$base; then d=.; else d=$(srcdir); fi; \
224 for file in $$d/$$base*; do \
225## Strip leading '$$d/'.
226 relfile=`expr "$$file" : "$$d/\(.*\)"`; \
227 test -f $(distdir)/$$relfile || \
228 cp -p $$file $(distdir)/$$relfile; \
229 done; \
230 done
231endif %?LOCAL-TEXIS%
232
233
234## ---------- ##
235## Cleaning. ##
236## ---------- ##
237
238## The funny name is due to --cygnus influence; in Cygnus mode,
239## `clean-info' is a target that users can use.
240
241if %?LOCAL-TEXIS%
242.PHONY: mostlyclean-aminfo
243mostlyclean-am: mostlyclean-aminfo
244mostlyclean-aminfo:
245 -rm -f %TEXICLEAN%
246
247.PHONY: maintainer-clean-aminfo
248maintainer-clean-am: maintainer-clean-aminfo
249maintainer-clean-aminfo:
250 @list='$(INFO_DEPS)'; for i in $$list; do \
251## .iNN files are DJGPP-style info files.
252 i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
253 echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
254 rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
255 done
256
257?CYGNUS?.PHONY: clean-info
258?CYGNUS?clean-info: mostlyclean-aminfo
259endif %?LOCAL-TEXIS%
Note: See TracBrowser for help on using the repository browser.