3 # Copyright (C) 1994, 1996-2015 Free Software Foundation, Inc.
5 # This file is part of GNU Emacs.
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.
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.
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/>.
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.
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
32 ## Directory with emacsver.texi.
33 emacsdir
= $(srcdir)/..
/emacs
36 datarootdir
= @datarootdir@
38 PACKAGE_TARNAME
= @PACKAGE_TARNAME@
47 GZIP_PROG
= @GZIP_PROG@
49 HTML_OPTS
= --no-split
--html
51 # Options used only when making info output.
52 # (Note that idlwave, info used --nosplit even without the .info extension.)
56 INSTALL_DATA
= @INSTALL_DATA@
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?)
62 MAKEINFO_OPTS
= --force -I
$(emacsdir
)
64 ## On MS Windows, efaq-w32; otherwise blank.
65 DOCMISC_W32
= @DOCMISC_W32@
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
77 ## Info files to install on current platform.
78 INFO_INSTALL
= $(INFO_COMMON
) $(DOCMISC_W32
)
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
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)
90 DVI_TARGETS
= $(TARGETS
:=.
dvi)
91 HTML_TARGETS
= $(TARGETS
:=.html
)
92 PDF_TARGETS
= $(TARGETS
:=.pdf
)
93 PS_TARGETS
= $(TARGETS
:=.ps
)
100 AM_DEFAULT_VERBOSITY
= @AM_DEFAULT_VERBOSITY@
102 AM_V_GEN
= $(am__v_GEN_@AM_V@
)
103 am__v_GEN_
= $(am__v_GEN_@AM_DEFAULT_V@
)
104 am__v_GEN_0
= @echo
" GEN " $@
;
107 ENVADD
= $(AM_V_GEN
)TEXINPUTS
="$(srcdir):$(emacsdir):$(TEXINPUTS)" \
108 MAKEINFO
="$(MAKEINFO) $(MAKEINFO_OPTS)"
110 gfdl
= ${srcdir}/doclicense.texi
112 .PHONY
: info dvi html pdf ps echo-info
$(INFO_TARGETS
)
113 ## Prevent implicit rule triggering for foo.info.
116 ## Disable implicit rules.
120 info: $(INFO_TARGETS
)
122 ## Used by top-level Makefile.
123 ## Base file names of output info files.
125 @echo
"$(INFO_INSTALL) " | \
126 sed
-e
's|[^ ]*/||g' -e
's/\.info//g' -e
"s/ */.info /g"
130 html
: $(HTML_TARGETS
)
139 ### The general case.
143 ${buildinfodir}/%.
info: ${srcdir}/%.texi
${gfdl} |
${buildinfodir}
144 $(AM_V_GEN
)$(MAKEINFO
) $(MAKEINFO_OPTS
) $(INFO_OPTS
) $(EXTRA_OPTS
) \
147 ## The short aliases, eg efaq = $(buildinfodir)/efaq.info.
149 $(1): $$(buildinfodir
)/$(1).
info
152 ## "info" is already taken.
153 info.
info: $(buildinfodir
)/info.
info
155 $(foreach ifile
,$(filter-out info.
info,$(INFO_TARGETS
)),$(eval
$(call info_template
,$(ifile
))))
158 %.
dvi: ${srcdir}/%.texi
${gfdl}
159 $(ENVADD
) $(TEXI2DVI
) $<
161 %.pdf
: ${srcdir}/%.texi
${gfdl}
162 $(ENVADD
) $(TEXI2PDF
) $<
164 %.html
: ${srcdir}/%.texi
${gfdl}
165 $(AM_V_GEN
)$(MAKEINFO
) $(MAKEINFO_OPTS
) $(HTML_OPTS
) $(EXTRA_OPTS
) \
174 ## Extra dependencies.
176 need_emacsver
= calc cl dired-x efaq efaq-w32 erc ido reftex woman
177 need_emacsver_prefix
= $(addprefix ${buildinfodir}/,${need_emacsver})
179 $(need_emacsver_prefix
:=.
info) $(need_emacsver
:=.
dvi) $(need_emacsver
:=.pdf
) $(need_emacsver
:=.html
) : ${emacsdir}/emacsver.texi
181 $(buildinfodir
)/gnus.
info gnus.html
: ${srcdir}/gnus-faq.texi
183 $(buildinfodir
)/semantic.
info semantic.
dvi semantic.pdf semantic.html
: ${srcdir}/sem-user.texi
186 ## Please can we just rename cc-mode.texi to ccmode.texi...
187 ${buildinfodir}/ccmode.
info: ${srcdir}/cc-mode.texi
${gfdl} |
${buildinfodir}
188 $(AM_V_GEN
)$(MAKEINFO
) $(MAKEINFO_OPTS
) $(INFO_OPTS
) -o
$@
$<
190 ## efaq, efaq_w32 do not depend on gfdl.
191 ## Maybe we can use .SECONDEXPANSION for this.
192 ${buildinfodir}/efaq
%.
info: ${srcdir}/efaq
%.texi |
${buildinfodir}
193 $(AM_V_GEN
)$(MAKEINFO
) $(MAKEINFO_OPTS
) $(INFO_OPTS
) -o
$@
$<
195 efaq
%.
dvi: ${srcdir}/efaq
%.texi
196 $(ENVADD
) $(TEXI2DVI
) $<
198 efaq
%.pdf
: ${srcdir}/efaq
%.texi
199 $(ENVADD
) $(TEXI2PDF
) $<
201 efaq
%.html
: ${srcdir}/efaq
%.texi
202 $(AM_V_GEN
)$(MAKEINFO
) $(MAKEINFO_OPTS
) $(HTML_OPTS
) -o
$@
$<
204 ${buildinfodir}/emacs-mime.
info emacs-mime.html
: EXTRA_OPTS
= --enable-encoding
206 gnus_deps
= ${srcdir}/gnus.texi
${srcdir}/gnus-faq.texi
${gfdl}
207 gnus.
dvi: $(gnus_deps
)
208 sed
-e
'/@iflatex/,/@end iflatex/d' $< > gnustmpdvi.texi
209 $(ENVADD
) $(TEXI2DVI
) gnustmpdvi.texi
213 gnus.pdf
: $(gnus_deps
)
214 sed
-e
'/@iflatex/,/@end iflatex/d' $< > gnustmppdf.texi
215 $(ENVADD
) $(TEXI2PDF
) gnustmppdf.texi
219 ${buildinfodir}/tramp.
info tramp.html
: EXTRA_OPTS
= -D emacs
220 ${buildinfodir}/tramp.
info tramp.html
: ${srcdir}/trampver.texi
223 .PHONY
: mostlyclean clean distclean bootstrap-clean maintainer-clean
226 rm -f
*.aux
*.log
*.toc
*.c
[mp
] *.c
[mp
]s
*.fn
*.fns \
227 *.ky
*.kys
*.op
*.ops
*.p
[gj
] *.p
[gj
]s
*.sc
*.scs
*.ss \
228 *.t
[gp
] *.t
[gp
]s
*.vr
*.vrs
232 rm -f
*.
dvi *.html
*.pdf
*.ps
237 ## buildinfodir is relative to srcdir.
239 for file in
$(INFO_TARGETS
); do \
240 file
=`echo $${file} | sed 's/\.info$$//'`.
info; \
242 $(buildinfodir
)/$${file} \
243 $(buildinfodir
)/$${file}-[1-9] \
244 $(buildinfodir
)/$${file}-[1-9][0-9]; \
247 bootstrap-clean maintainer-clean
: distclean infoclean
249 .PHONY
: install-dvi install-html install-pdf install-ps install-doc
252 umask
022; $(MKDIR_P
) "$(DESTDIR)$(dvidir)"
253 $(INSTALL_DATA
) $(DVI_TARGETS
) "$(DESTDIR)$(dvidir)"
255 umask
022; $(MKDIR_P
) "$(DESTDIR)$(htmldir)"
256 $(INSTALL_DATA
) $(HTML_TARGETS
) "$(DESTDIR)$(htmldir)"
258 umask
022;$(MKDIR_P
) "$(DESTDIR)$(pdfdir)"
259 $(INSTALL_DATA
) $(PDF_TARGETS
) "$(DESTDIR)$(pdfdir)"
261 umask
022; $(MKDIR_P
) "$(DESTDIR)$(psdir)"
262 for file in
$(PS_TARGETS
); do \
263 $(INSTALL_DATA
) $${file} "$(DESTDIR)$(psdir)"; \
264 [ -n
"${GZIP_PROG}" ] || continue
; \
265 rm -f
"$(DESTDIR)$(psdir)/$${file}.gz"; \
266 ${GZIP_PROG} -9n
"$(DESTDIR)$(psdir)/$${file}"; \
269 ## Top-level Makefile installs the info pages.
270 install-doc
: install-dvi install-html install-pdf install-ps
274 .PHONY
: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps uninstall-doc
277 for file in
$(DVI_TARGETS
); do \
278 rm -f
"$(DESTDIR)$(dvidir)/$${file}"; \
281 for file in
$(HTML_TARGETS
); do \
282 rm -f
"$(DESTDIR)$(htmldir)/$${file}"; \
285 ext
= ; [ -n
"${GZIP_PROG}" ] && ext
=.gz
; \
286 for file in
$(PS_TARGETS
); do \
287 rm -f
"$(DESTDIR)$(psdir)/$${file}$${ext}"; \
290 for file in
$(PDF_TARGETS
); do \
291 rm -f
"$(DESTDIR)$(pdfdir)/$${file}"; \
294 uninstall-doc
: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps
297 ### Makefile ends here