summaryrefslogtreecommitdiff
path: root/lib/am/texinfos.am
blob: b7efd82635d99c9ce397a233021f4bba4998ca43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
## automake - create Makefile.in from Makefile.am

## Copyright (C) 1994-2012 Free Software Foundation, Inc.

## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.

## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.

## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.

## FIXME: this should probably be moved to header-vars.am ...
am__create_installdir = $(if $(and $1,$^),$(MKDIR_P) '$(DESTDIR)$1',@:)


## ---------- ##
## Building.  ##
## ---------- ##

.PHONY: dvi dvi-am html html-am info info-am pdf pdf-am ps ps-am
if %?SUBDIRS%
RECURSIVE_TARGETS += dvi-recursive html-recursive info-recursive
RECURSIVE_TARGETS += pdf-recursive ps-recursive
dvi: dvi-recursive
html: html-recursive
info: info-recursive
pdf: pdf-recursive
ps: ps-recursive
else !%?SUBDIRS%
dvi: dvi-am
html: html-am
info: info-am
pdf: pdf-am
ps: ps-am
endif !%?SUBDIRS%

if %?LOCAL-TEXIS%
dvi-am: $(DVIS)
html-am: $(HTMLS)
info-am: $(INFO_DEPS)
pdf-am: $(PDFS)
ps-am: $(PSS)
else ! %?LOCAL-TEXIS%
dvi-am:
html-am:
info-am:
pdf-am:
ps-am:
endif ! %?LOCAL-TEXIS%


## ------------ ##
## Installing.  ##
## ------------ ##

## Some code should be run only if install-info actually exists, and
## if the user doesn't request it not to be run (through the
## 'AM_UPDATE_INFO_DIR' environment variable).  See automake bug#9773
## and Debian Bug#543992.
if %?FIRST%
am__can_run_installinfo = \
  case $$AM_UPDATE_INFO_DIR in \
    n|no|NO) false;; \
    *) (install-info --version) >/dev/null 2>&1;; \
  esac
endif

## Look in both . and srcdir because the info pages might have been
## rebuilt in the build directory.  Can't cd to srcdir; that might
## break a possible install-sh reference.
##
## Funny name due to --cygnus influence; we want to reserve
## 'install-info' for the user.
##
## TEXINFOS primary are always installed in infodir, hence install-data
## is hard coded.
if %?INSTALL-INFO%
if %?LOCAL-TEXIS%
am__installdirs += "$(DESTDIR)$(infodir)"
install-data-am: install-info-am
endif %?LOCAL-TEXIS%
endif %?INSTALL-INFO%
.PHONY: \
  install-dvi  install-dvi-am \
  install-html install-html-am \
  install-info install-info-am \
  install-pdf  install-pdf-am \
  install-ps   install-ps-am

if %?SUBDIRS%
RECURSIVE_TARGETS += \
  install-dvi-recursive \
  install-html-recursive \
  install-info-recursive \
  install-pdf-recursive \
  install-ps-recursive
install-dvi: install-dvi-recursive
install-html: install-html-recursive
install-info: install-info-recursive
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
else !%?SUBDIRS%
install-dvi: install-dvi-am
install-html: install-html-am
install-info: install-info-am
install-pdf: install-pdf-am
install-ps: install-ps-am
endif !%?SUBDIRS%

if %?LOCAL-TEXIS%

include inst-vars.am

# In GNU make, '$^' used in a recipe contains every dependency for the
# target, even those not declared when the recipe is read; for example,
# on:
#    all: foo1; @echo $^
#    all: foo2
# "make all" would output "foo1 foo2".  In our usage, a dependency like
# "install-pdf-am: install-pdf-local" (that is automatically output by
# Automake-NG if the 'install-pdf-local' target is declared) would make
# '$^' unusable as a pure list of PDF target files in the recipe of
# 'install-pdf-am'.  So we need the following indirections.

install-dvi-am:  am--install-dvi
install-ps-am:   am--install-ps
install-pdf-am:  am--install-pdf
install-info-am: am--install-info
install-html-am: am--install-html

am--install-html: $(HTMLS)
	@$(NORMAL_INSTALL)
	$(call am__create_installdir,$(htmldir))
	@list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
	for p in $$list; do \
	  if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  $(am__strip_dir) \
## This indirection is required to work around a bug of the Solaris 10
## shell /usr/xpg4/bin/sh.  The description of the bug can be found at
## <http://lists.gnu.org/archive/html/bug-autoconf/2011-11/msg00005.html>
## and the report of the original failure can be found at automake
## bug#10026 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10026#23>
	  d2=$$d$$p; \
	  if test -d "$$d2"; then \
	    echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
	    $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
	    echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
	    $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
	  else \
	    list2="$$list2 $$d2"; \
	  fi; \
	done; \
	test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
	while read files; do \
	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
	  $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
	done; }

am--install-info: $(INFO_DEPS)
	@$(NORMAL_INSTALL)
	$(call am__create_installdir,$(infodir))
	@list='$(and $(infodir),$^)'; test -n "$$list" || exit 0; \
	for file in $$list; do \
	  for ifile in $$file $$file-[0-9] $$file-[0-9][0-9]; do \
	    test ! -f $$ifile || echo "$$ifile"; \
	  done; \
	done | $(am__base_list) | \
	while read files; do \
	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
	  $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; \
	done
	@$(POST_INSTALL)
	@$(am__can_run_installinfo) || exit 0; \
	rellist='$(notdir $(and $(infodir),$^))'; \
	test -n "$$rellist" || exit 0; \
	for relfile in $$rellist; do \
	  echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
## Run ":" after install-info in case install-info fails.  We really
## don't care about failures here, because they can be spurious.  For
## instance if you don't have a dir file, install-info will fail.  I
## think instead it should create a new dir file for you.  This bug
## causes the "make distcheck" target to fail reliably.
	  install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
	done; \

am--install-dvi: $(DVIS)
	@$(NORMAL_INSTALL)
	$(call am__create_installdir,$(dvidir))
	@list='$(and $(dvidir),$^)'; test -n "$$list" || exit 0; \
	for p in $$list; do echo "$$p"; done | $(am__base_list) | \
	while read files; do \
	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
	  $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
	done

am--install-pdf: $(PDFS)
	@$(NORMAL_INSTALL)
	$(call am__create_installdir,$(pdfdir))
	@list='$(and $(pdfdir),$^)'; test -n "$$list" || exit 0; \
	for p in $$list; do echo "$$p"; done | $(am__base_list) | \
	while read files; do \
	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; \
	done

am--install-ps: $(PSS)
	@$(NORMAL_INSTALL)
	$(call am__create_installdir,$(psdir))
	@list='$(and $(psdir),$^)'; test -n "$$list" || exit 0; \
	for p in $$list; do echo "$$p"; done | $(am__base_list) | \
	while read files; do \
	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
	  $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; \
	done

else ! %?LOCAL-TEXIS%
install-dvi-am:
install-html-am:
install-info-am:
install-pdf-am:
install-ps-am:
endif ! %?LOCAL-TEXIS%


## -------------- ##
## Uninstalling.  ##
## -------------- ##

if %?LOCAL-TEXIS%
.PHONY uninstall-am: \
  uninstall-dvi-am \
  uninstall-html-am \
  uninstall-info-am \
  uninstall-ps-am \
  uninstall-pdf-am

uninstall-dvi-am:
	@$(NORMAL_UNINSTALL)
	$(if $(and $(DVIS),$(dvidir)),rm -f $(addprefix '$(DESTDIR)$(dvidir)'/,$(notdir $(DVIS))))

uninstall-pdf-am:
	@$(NORMAL_UNINSTALL)
	$(if $(and $(PDFS),$(pdfdir)),rm -f $(addprefix '$(DESTDIR)$(pdfdir)'/,$(notdir $(PDFS))))

uninstall-ps-am:
	@$(NORMAL_UNINSTALL)
	$(if $(and $(PSS),$(psdir)),rm -f $(addprefix '$(DESTDIR)$(psdir)'/,$(notdir $(PSS))))

uninstall-html-am:
	@$(NORMAL_UNINSTALL)
## The HTML 'files' can be directories actually, hence the '-r'.
	$(if $(and $(HTMLS),$(htmldir)),rm -rf $(addprefix '$(DESTDIR)$(htmldir)'/,$(notdir $(HTMLS))))

uninstall-info-am:
	@$(PRE_UNINSTALL)
## Run two loops here so that we can handle PRE_UNINSTALL and
## NORMAL_UNINSTALL correctly.
	@if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
	  list='$(INFO_DEPS)'; \
	  for file in $$list; do \
	    relfile=`echo "$$file" | sed 's|^.*/||'`; \
## install-info needs the actual info file.  We use the installed one,
## rather than relying on one still being in srcdir or builddir.
## However, "make uninstall && make uninstall" should not fail,
## so we ignore failure if the file did not exist.
	    echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
	    if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
	    then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
	  done; \
	else :; fi
	@$(NORMAL_UNINSTALL)
	@list='$(INFO_DEPS)'; \
	for file in $$list; do \
	  relfile=`echo "$$file" | sed 's|^.*/||'`; \
	  (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
	     echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]"; \
	     rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9]; \
	   else :; fi); \
	done

endif %?LOCAL-TEXIS%

if %?LOCAL-TEXIS%
.PHONY: dist-info
dist-info: $(INFO_DEPS)
	@$(foreach f,$(foreach x,$^,$(wildcard $x $x-[0-9] $x-[0-9][0-9])), \
	  cp -p $f $(distdir)/$(patsubst $(srcdir)/%,%,$f);)
endif %?LOCAL-TEXIS%


## ---------- ##
## Cleaning.  ##
## ---------- ##

if %?LOCAL-TEXIS%
## Append to dirs, not files, because the %*CLEAN% substitutions can
## also contain any directory created by "makeinfo --html", as well as
## the '*.t2d' and '*.t2p' directories used by texi2dvi and texi2pdf.
am__mostlyclean_dirs += %MOSTLYCLEAN%
am__clean_dirs += %TEXICLEAN%
am__maintclean_dirs += %MAINTCLEAN%

am__maintclean_files += $(foreach f,$(INFO_DEPS),$f $f-[0-9] $f-[0-9][0-9])

endif %?LOCAL-TEXIS%