]> code.delx.au - gnu-emacs/blob - doc/misc/Makefile.in
Merge from origin/emacs-24
[gnu-emacs] / doc / misc / Makefile.in
1 ### @configure_input@
2
3 # Copyright (C) 1994, 1996-2014 Free Software Foundation, Inc.
4
5 # This file is part of GNU Emacs.
6
7 # GNU Emacs is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # GNU Emacs is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20 SHELL = @SHELL@
21
22 # Where to find the source code. $(srcdir) will be the doc/misc subdirectory
23 # of the source tree. This is set by configure's `--srcdir' option.
24 srcdir=@srcdir@
25
26 ## Where the output files go.
27 ## Note that all the Info targets build the Info files in srcdir.
28 ## There is no provision for Info files to exist in the build directory.
29 ## In a tarfile of Emacs, the Info files should be up to date.
30 buildinfodir = $(srcdir)/../../info
31
32 ## Directory with emacsver.texi.
33 emacsdir = $(srcdir)/../emacs
34
35 prefix = @prefix@
36 datarootdir = @datarootdir@
37 datadir = @datadir@
38 PACKAGE_TARNAME = @PACKAGE_TARNAME@
39 docdir = @docdir@
40 dvidir = @dvidir@
41 htmldir = @htmldir@
42 pdfdir = @pdfdir@
43 psdir = @psdir@
44
45 MKDIR_P = @MKDIR_P@
46
47 GZIP_PROG = @GZIP_PROG@
48
49 HTML_OPTS = --no-split --html
50
51 # Options used only when making info output.
52 # (Note that idlwave, info used --nosplit even without the .info extension.)
53 INFO_OPTS= --no-split
54
55 INSTALL = @INSTALL@
56 INSTALL_DATA = @INSTALL_DATA@
57
58 # The makeinfo program is part of the Texinfo distribution.
59 # Use --force so that it generates output even if there are errors.
60 # (TODO? Why is this appropriate?)
61 MAKEINFO = @MAKEINFO@
62 MAKEINFO_OPTS = --force -I$(emacsdir)
63
64 ## On MS Windows, efaq-w32; otherwise blank.
65 DOCMISC_W32 = @DOCMISC_W32@
66
67 ## Info files to build and install on all platforms.
68 INFO_COMMON = ada-mode auth autotype bovine calc ccmode cl \
69 dbus dired-x ebrowse ede ediff edt eieio \
70 emacs-mime epa erc ert eshell eudc efaq eww \
71 flymake forms gnus emacs-gnutls htmlfontify idlwave ido info.info \
72 mairix-el message mh-e newsticker nxml-mode octave-mode \
73 org pcl-cvs pgg rcirc remember reftex sasl \
74 sc semantic ses sieve smtpmail speedbar srecode todo-mode tramp \
75 url vhdl-mode vip viper widget wisent woman
76
77 ## Info files to install on current platform.
78 INFO_INSTALL = $(INFO_COMMON) $(DOCMISC_W32)
79
80 ## Info files to build on current platform.
81 ## This is all of them, even though they might not all get installed,
82 ## because the info files are pre-built in release tarfiles.
83 INFO_TARGETS = $(INFO_COMMON) efaq-w32
84
85 # There are some naming differences between the info targets and the other
86 # targets, so let's resolve them here.
87 TARGETS_1 = $(INFO_INSTALL:ccmode=cc-mode)
88 TARGETS = $(TARGETS_1:info.info=info)
89
90 DVI_TARGETS = $(TARGETS:=.dvi)
91 HTML_TARGETS = $(TARGETS:=.html)
92 PDF_TARGETS = $(TARGETS:=.pdf)
93 PS_TARGETS = $(TARGETS:=.ps)
94
95 TEXI2DVI = texi2dvi
96 TEXI2PDF = texi2pdf
97 DVIPS = dvips
98
99 ENVADD = TEXINPUTS="$(srcdir):$(emacsdir):$(TEXINPUTS)" \
100 MAKEINFO="$(MAKEINFO) $(MAKEINFO_OPTS)"
101
102 gfdl = ${srcdir}/doclicense.texi
103
104 .PHONY: info dvi html pdf ps echo-info $(INFO_TARGETS)
105 ## Prevent implicit rule triggering for foo.info.
106 .SUFFIXES:
107
108 ## Disable implicit rules.
109 %.texi: ;
110
111 # Default.
112 info: $(INFO_TARGETS)
113
114 ## Used by top-level Makefile.
115 ## Base file names of output info files.
116 echo-info:
117 @echo "$(INFO_INSTALL) " | \
118 sed -e 's|[^ ]*/||g' -e 's/\.info//g' -e "s/ */.info /g"
119
120 dvi: $(DVI_TARGETS)
121
122 html: $(HTML_TARGETS)
123
124 pdf: $(PDF_TARGETS)
125
126 ps: $(PS_TARGETS)
127
128 ${buildinfodir}:
129 ${MKDIR_P} $@
130
131 ### The general case.
132
133 EXTRA_OPTS =
134
135 ${buildinfodir}/%.info: ${srcdir}/%.texi ${gfdl} | ${buildinfodir}
136 $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) $(EXTRA_OPTS) -o $@ $<
137
138 ## The short aliases, eg efaq = $(buildinfodir)/efaq.info.
139 define info_template
140 $(1): $$(buildinfodir)/$(1).info
141 endef
142
143 ## "info" is already taken.
144 info.info: $(buildinfodir)/info.info
145
146 $(foreach ifile,$(filter-out info.info,$(INFO_TARGETS)),$(eval $(call info_template,$(ifile))))
147
148
149 %.dvi: ${srcdir}/%.texi ${gfdl}
150 $(ENVADD) $(TEXI2DVI) $<
151
152 %.pdf: ${srcdir}/%.texi ${gfdl}
153 $(ENVADD) $(TEXI2PDF) $<
154
155 %.html: ${srcdir}/%.texi ${gfdl}
156 $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) $(EXTRA_OPTS) -o $@ $<
157
158 %.ps: %.dvi
159 $(DVIPS) -o $@ $<
160
161
162 ### The exceptions.
163
164 ## Extra dependencies.
165
166 need_emacsver = calc cl dired-x efaq efaq-w32 erc ido reftex woman
167 need_emacsver_prefix = $(addprefix ${buildinfodir}/,${need_emacsver})
168
169 $(need_emacsver_prefix:=.info) $(need_emacsver:=.dvi) $(need_emacsver:=.pdf) $(need_emacsver:=.html) : ${emacsdir}/emacsver.texi
170
171 $(buildinfodir)/gnus.info gnus.html: ${srcdir}/gnus-faq.texi
172
173 $(buildinfodir)/semantic.info semantic.dvi semantic.pdf semantic.html: ${srcdir}/sem-user.texi
174
175
176 ## Please can we just rename cc-mode.texi to ccmode.texi...
177 ${buildinfodir}/ccmode.info: ${srcdir}/cc-mode.texi ${gfdl} | ${buildinfodir}
178 $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
179
180 ## efaq, efaq_w32 do not depend on gfdl.
181 ## Maybe we can use .SECONDEXPANSION for this.
182 ${buildinfodir}/efaq%.info: ${srcdir}/efaq%.texi | ${buildinfodir}
183 $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
184
185 efaq%.dvi: ${srcdir}/efaq%.texi
186 $(ENVADD) $(TEXI2DVI) $<
187
188 efaq%.pdf: ${srcdir}/efaq%.texi
189 $(ENVADD) $(TEXI2PDF) $<
190
191 efaq%.html: ${srcdir}/efaq%.texi
192 $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ $<
193
194 ${buildinfodir}/emacs-mime.info emacs-mime.html: EXTRA_OPTS = --enable-encoding
195
196 gnus_deps = ${srcdir}/gnus.texi ${srcdir}/gnus-faq.texi ${gfdl}
197 gnus.dvi: $(gnus_deps)
198 sed -e '/@iflatex/,/@end iflatex/d' $< > gnustmpdvi.texi
199 $(ENVADD) $(TEXI2DVI) gnustmpdvi.texi
200 cp gnustmpdvi.dvi $@
201 rm gnustmpdvi.*
202
203 gnus.pdf: $(gnus_deps)
204 sed -e '/@iflatex/,/@end iflatex/d' $< > gnustmppdf.texi
205 $(ENVADD) $(TEXI2PDF) gnustmppdf.texi
206 cp gnustmppdf.pdf $@
207 rm gnustmppdf.*
208
209 ${buildinfodir}/tramp.info tramp.html: EXTRA_OPTS = -D emacs
210 ${buildinfodir}/tramp.info tramp.html: ${srcdir}/trampver.texi
211
212
213 .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
214
215 mostlyclean:
216 rm -f *.aux *.log *.toc *.c[mp] *.c[mp]s *.fn *.fns \
217 *.ky *.kys *.op *.ops *.p[gj] *.p[gj]s *.sc *.scs *.ss \
218 *.t[gp] *.t[gp]s *.vr *.vrs
219 rm -f gnustmp*
220
221 clean: mostlyclean
222 rm -f *.dvi *.html *.pdf *.ps
223
224 distclean: clean
225 rm -f Makefile
226
227 ## buildinfodir is relative to srcdir.
228 infoclean:
229 for file in $(INFO_TARGETS); do \
230 file=`echo $${file} | sed 's/\.info$$//'`.info; \
231 rm -f \
232 $(buildinfodir)/$${file} \
233 $(buildinfodir)/$${file}-[1-9] \
234 $(buildinfodir)/$${file}-[1-9][0-9]; \
235 done
236
237 bootstrap-clean maintainer-clean: distclean infoclean
238
239 .PHONY: install-dvi install-html install-pdf install-ps install-doc
240
241 install-dvi: dvi
242 umask 022; $(MKDIR_P) "$(DESTDIR)$(dvidir)"
243 $(INSTALL_DATA) $(DVI_TARGETS) "$(DESTDIR)$(dvidir)"
244 install-html: html
245 umask 022; $(MKDIR_P) "$(DESTDIR)$(htmldir)"
246 $(INSTALL_DATA) $(HTML_TARGETS) "$(DESTDIR)$(htmldir)"
247 install-pdf: pdf
248 umask 022;$(MKDIR_P) "$(DESTDIR)$(pdfdir)"
249 $(INSTALL_DATA) $(PDF_TARGETS) "$(DESTDIR)$(pdfdir)"
250 install-ps: ps
251 umask 022; $(MKDIR_P) "$(DESTDIR)$(psdir)"
252 for file in $(PS_TARGETS); do \
253 $(INSTALL_DATA) $${file} "$(DESTDIR)$(psdir)"; \
254 [ -n "${GZIP_PROG}" ] || continue; \
255 rm -f "$(DESTDIR)$(psdir)/$${file}.gz"; \
256 ${GZIP_PROG} -9n "$(DESTDIR)$(psdir)/$${file}"; \
257 done
258
259 ## Top-level Makefile installs the info pages.
260 install-doc: install-dvi install-html install-pdf install-ps
261
262
263
264 .PHONY: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps uninstall-doc
265
266 uninstall-dvi:
267 for file in $(DVI_TARGETS); do \
268 rm -f "$(DESTDIR)$(dvidir)/$${file}"; \
269 done
270 uninstall-html:
271 for file in $(HTML_TARGETS); do \
272 rm -f "$(DESTDIR)$(htmldir)/$${file}"; \
273 done
274 uninstall-ps:
275 ext= ; [ -n "${GZIP_PROG}" ] && ext=.gz; \
276 for file in $(PS_TARGETS); do \
277 rm -f "$(DESTDIR)$(psdir)/$${file}$${ext}"; \
278 done
279 uninstall-pdf:
280 for file in $(PDF_TARGETS); do \
281 rm -f "$(DESTDIR)$(pdfdir)/$${file}"; \
282 done
283
284 uninstall-doc: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps
285
286
287 ### Makefile ends here