Fix ‘make clean’ with a file named ‘-.o’
[emacs.git] / doc / emacs / Makefile.in
blob54e173f8d676c2fc545cc6220b23595720d7b5a7
1 ### @configure_input@
3 # Copyright (C) 1994, 1996-2018 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 <https://www.gnu.org/licenses/>.
20 SHELL = @SHELL@
22 # NB If you add any more configure variables,
23 # update the sed rules in the dist target below.
25 # Where to find the source code. $(srcdir) will be the doc/emacs subdirectory
26 # of the source tree. This is set by configure's '--srcdir' option.
27 srcdir=@srcdir@
29 top_srcdir = @top_srcdir@
31 version = @version@
33 ## Where the output files go.
34 ## Note that the setfilename command in the .texi files assumes this.
35 ## This is a bit funny. Because the info files are in the
36 ## distribution tarfiles, they are always made in $scrdir/../../info,
37 ## even for out-of-tree builds.
38 buildinfodir = $(srcdir)/../../info
39 # Directory with the (customized) texinfo.tex file.
40 texinfodir = $(srcdir)/../misc
42 prefix = @prefix@
43 datarootdir = @datarootdir@
44 datadir = @datadir@
45 PACKAGE_TARNAME = @PACKAGE_TARNAME@
46 docdir = @docdir@
47 dvidir = @dvidir@
48 htmldir = @htmldir@
49 pdfdir = @pdfdir@
50 psdir = @psdir@
52 MKDIR_P = @MKDIR_P@
54 GZIP_PROG = @GZIP_PROG@
56 HTML_OPTS = --no-split --html
58 # Options used only when making info output.
59 # --no-split is only needed because of MS-DOS.
60 # For a possible alternative, see
61 # https://lists.gnu.org/r/emacs-devel/2011-01/msg01182.html
62 INFO_OPTS= --no-split
64 INSTALL = @INSTALL@
65 INSTALL_DATA = @INSTALL_DATA@
67 # The makeinfo program is part of the Texinfo distribution.
68 # Use --force so that it generates output even if there are errors.
69 MAKEINFO = @MAKEINFO@
70 MAKEINFO_OPTS = --force --enable-encoding -I $(srcdir)
72 TEXI2DVI = texi2dvi
73 TEXI2PDF = texi2pdf
74 DVIPS = dvips
76 # 'make' verbosity.
77 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
79 AM_V_GEN = $(am__v_GEN_@AM_V@)
80 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
81 am__v_GEN_0 = @echo " GEN " $@;
82 am__v_GEN_1 =
84 ENVADD = $(AM_V_GEN)TEXINPUTS="$(srcdir):$(texinfodir):$(TEXINPUTS)" \
85 MAKEINFO="$(MAKEINFO) $(MAKEINFO_OPTS)"
87 DVI_TARGETS = emacs.dvi emacs-xtra.dvi
88 HTML_TARGETS = emacs.html
89 PDF_TARGETS = emacs.pdf emacs-xtra.pdf
90 PS_TARGETS = emacs.ps emacs-xtra.ps
92 EMACS_XTRA= \
93 ${srcdir}/emacs-xtra.texi \
94 $(srcdir)/arevert-xtra.texi \
95 $(srcdir)/cal-xtra.texi \
96 $(srcdir)/dired-xtra.texi \
97 ${srcdir}/docstyle.texi \
98 $(srcdir)/picture-xtra.texi \
99 $(srcdir)/emerge-xtra.texi \
100 $(srcdir)/vc-xtra.texi \
101 $(srcdir)/vc1-xtra.texi \
102 $(srcdir)/fortran-xtra.texi \
103 $(srcdir)/msdos-xtra.texi
105 EMACSSOURCES= \
106 ${srcdir}/emacs.texi \
107 ${srcdir}/emacsver.texi \
108 ${srcdir}/doclicense.texi \
109 ${srcdir}/gpl.texi \
110 ${srcdir}/screen.texi \
111 ${srcdir}/commands.texi \
112 ${srcdir}/entering.texi \
113 ${srcdir}/basic.texi \
114 ${srcdir}/mini.texi \
115 ${srcdir}/m-x.texi \
116 ${srcdir}/help.texi \
117 ${srcdir}/mark.texi \
118 ${srcdir}/killing.texi \
119 ${srcdir}/regs.texi \
120 ${srcdir}/display.texi \
121 ${srcdir}/search.texi \
122 ${srcdir}/fixit.texi \
123 ${srcdir}/files.texi \
124 ${srcdir}/buffers.texi \
125 ${srcdir}/windows.texi \
126 ${srcdir}/frames.texi \
127 ${srcdir}/mule.texi \
128 ${srcdir}/modes.texi \
129 ${srcdir}/indent.texi \
130 ${srcdir}/text.texi \
131 ${srcdir}/programs.texi \
132 ${srcdir}/building.texi \
133 ${srcdir}/maintaining.texi \
134 ${srcdir}/abbrevs.texi \
135 ${srcdir}/sending.texi \
136 ${srcdir}/rmail.texi \
137 ${srcdir}/dired.texi \
138 ${srcdir}/calendar.texi \
139 ${srcdir}/misc.texi \
140 ${srcdir}/package.texi \
141 ${srcdir}/custom.texi \
142 ${srcdir}/trouble.texi \
143 ${srcdir}/cmdargs.texi \
144 ${srcdir}/xresources.texi \
145 ${srcdir}/anti.texi \
146 ${srcdir}/macos.texi \
147 ${srcdir}/msdos.texi \
148 ${srcdir}/gnu.texi \
149 ${srcdir}/glossary.texi \
150 ${srcdir}/ack.texi \
151 ${srcdir}/kmacro.texi \
152 $(EMACS_XTRA)
154 ## Disable implicit rules.
155 %.texi: ;
157 .PHONY: info dvi html pdf ps
159 info: $(buildinfodir)/emacs.info
160 dvi: $(DVI_TARGETS)
161 html: $(HTML_TARGETS)
162 pdf: $(PDF_TARGETS)
163 ps: $(PS_TARGETS)
165 ## The info/ directory exists in release tarfiles but not the repository.
166 ${buildinfodir}:
167 ${MKDIR_P} $@
169 # Note that all the Info targets build the Info files in srcdir.
170 # There is no provision for Info files to exist in the build directory.
171 # In a distribution of Emacs, the Info files should be up to date.
172 $(buildinfodir)/emacs.info: ${EMACSSOURCES} | ${buildinfodir}
173 $(AM_V_GEN)$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
175 emacs.dvi: ${EMACSSOURCES}
176 $(ENVADD) $(TEXI2DVI) $<
178 emacs.pdf: ${EMACSSOURCES}
179 $(ENVADD) $(TEXI2PDF) $<
181 emacs.html: ${EMACSSOURCES}
182 $(AM_V_GEN)$(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ $<
184 emacs-xtra.dvi: $(EMACS_XTRA)
185 $(ENVADD) $(TEXI2DVI) $<
187 emacs-xtra.pdf: $(EMACS_XTRA)
188 $(ENVADD) $(TEXI2PDF) $<
190 %.ps: %.dvi
191 $(DVIPS) -o $@ $<
193 .PHONY: doc-emacsver
195 # If configure were to just generate emacsver.texi from emacsver.texi.in
196 # in the normal way, the timestamp of emacsver.texi would always be
197 # newer than that of the info files, which are prebuilt in release tarfiles.
198 # So we use this rule, and move-if-change, to avoid that.
199 doc-emacsver:
200 sed 's/[@]version@/${version}/' \
201 ${srcdir}/emacsver.texi.in > emacsver.texi.$$$$ && \
202 ${top_srcdir}/build-aux/move-if-change emacsver.texi.$$$$ \
203 ${srcdir}/emacsver.texi
205 .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean infoclean
207 ## Temp files.
208 mostlyclean:
209 rm -f ./*.aux ./*.log ./*.toc ./*.cp ./*.cps ./*.fn ./*.fns ./*.ky ./*.kys \
210 ./*.op ./*.ops ./*.pg ./*.pgs ./*.tp ./*.tps ./*.vr ./*.vrs
212 ## Products not in the release tarfiles.
213 clean: mostlyclean
214 rm -f $(DVI_TARGETS) $(HTML_TARGETS) $(PDF_TARGETS) $(PS_TARGETS)
216 distclean: clean
217 rm -f Makefile
219 ## In the standalone tarfile, the clean rule runs this.
220 infoclean:
221 rm -f \
222 $(buildinfodir)/emacs.info \
223 $(buildinfodir)/emacs.info-[1-9] \
224 $(buildinfodir)/emacs.info-[1-9][0-9]
226 bootstrap-clean maintainer-clean: distclean infoclean
227 rm -f ${srcdir}/emacsver.texi
229 .PHONY: install-dvi install-html install-pdf install-ps install-doc
231 install-dvi: dvi
232 umask 022; $(MKDIR_P) "$(DESTDIR)$(dvidir)"
233 $(INSTALL_DATA) $(DVI_TARGETS) "$(DESTDIR)$(dvidir)"
234 install-html: html
235 umask 022; $(MKDIR_P) "$(DESTDIR)$(htmldir)"
236 $(INSTALL_DATA) $(HTML_TARGETS) "$(DESTDIR)$(htmldir)"
237 install-pdf: pdf
238 umask 022;$(MKDIR_P) "$(DESTDIR)$(pdfdir)"
239 $(INSTALL_DATA) $(PDF_TARGETS) "$(DESTDIR)$(pdfdir)"
240 install-ps: ps
241 umask 022; $(MKDIR_P) "$(DESTDIR)$(psdir)"
242 for file in $(PS_TARGETS); do \
243 $(INSTALL_DATA) $${file} "$(DESTDIR)$(psdir)"; \
244 [ -n "${GZIP_PROG}" ] || continue; \
245 rm -f "$(DESTDIR)$(psdir)/$${file}.gz"; \
246 ${GZIP_PROG} -9n "$(DESTDIR)$(psdir)/$${file}"; \
247 done
249 ## Top-level Makefile installs the info pages.
250 install-doc: install-dvi install-html install-pdf install-ps
253 .PHONY: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps uninstall-doc
255 uninstall-dvi:
256 for file in $(DVI_TARGETS); do \
257 rm -f "$(DESTDIR)$(dvidir)/$${file}"; \
258 done
259 uninstall-html:
260 for file in $(HTML_TARGETS); do \
261 rm -f "$(DESTDIR)$(htmldir)/$${file}"; \
262 done
263 uninstall-ps:
264 ext= ; [ -n "${GZIP_PROG}" ] && ext=.gz; \
265 for file in $(PS_TARGETS); do \
266 rm -f "$(DESTDIR)$(psdir)/$${file}$${ext}"; \
267 done
268 uninstall-pdf:
269 for file in $(PDF_TARGETS); do \
270 rm -f "$(DESTDIR)$(pdfdir)/$${file}"; \
271 done
273 uninstall-doc: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps
276 ### Makefile ends here