* README: Remove some unnecessary detail.
[emacs.git] / doc / emacs / Makefile.in
blob352768517fac98138c3fd2edc3126cfe495dcf9f
1 ### @configure_input@
3 # Copyright (C) 1994, 1996-2014 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/>.
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 # Only for make dist.
30 version=@version@
32 ## Where the output files go.
33 ## Note that the setfilename command in the .texi files assumes this.
34 ## This is a bit funny. Because the info files are in the
35 ## distribution tarfiles, they are always made in $scrdir/../../info,
36 ## even for out-of-tree builds.
37 buildinfodir = $(srcdir)/../../info
38 # Directory with the (customized) texinfo.tex file.
39 texinfodir = $(srcdir)/../misc
41 prefix = @prefix@
42 datarootdir = @datarootdir@
43 datadir = @datadir@
44 PACKAGE_TARNAME = @PACKAGE_TARNAME@
45 docdir = @docdir@
46 dvidir = @dvidir@
47 htmldir = @htmldir@
48 pdfdir = @pdfdir@
49 psdir = @psdir@
51 MKDIR_P = @MKDIR_P@
53 GZIP_PROG = @GZIP_PROG@
55 HTML_OPTS = --no-split --html
57 # Options used only when making info output.
58 # --no-split is only needed because of MS-DOS.
59 # For a possible alternative, see
60 # http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01182.html
61 INFO_OPTS= --no-split
63 INSTALL = @INSTALL@
64 INSTALL_DATA = @INSTALL_DATA@
66 # The makeinfo program is part of the Texinfo distribution.
67 # Use --force so that it generates output even if there are errors.
68 MAKEINFO = @MAKEINFO@
69 MAKEINFO_OPTS = --force --enable-encoding -I $(srcdir)
71 TEXI2DVI = texi2dvi
72 TEXI2PDF = texi2pdf
73 DVIPS = dvips
76 ENVADD = TEXINPUTS="$(srcdir):$(texinfodir):$(TEXINPUTS)" \
77 MAKEINFO="$(MAKEINFO) $(MAKEINFO_OPTS)"
79 DVI_TARGETS = emacs.dvi emacs-xtra.dvi
80 HTML_TARGETS = emacs.html
81 PDF_TARGETS = emacs.pdf emacs-xtra.pdf
82 PS_TARGETS = emacs.ps emacs-xtra.ps
84 EMACS_XTRA= \
85 ${srcdir}/emacs-xtra.texi \
86 $(srcdir)/arevert-xtra.texi \
87 $(srcdir)/cal-xtra.texi \
88 $(srcdir)/dired-xtra.texi \
89 $(srcdir)/picture-xtra.texi \
90 $(srcdir)/emerge-xtra.texi \
91 $(srcdir)/vc-xtra.texi \
92 $(srcdir)/vc1-xtra.texi \
93 $(srcdir)/fortran-xtra.texi \
94 $(srcdir)/msdos-xtra.texi
96 EMACSSOURCES= \
97 ${srcdir}/emacs.texi \
98 ${srcdir}/emacsver.texi \
99 ${srcdir}/doclicense.texi \
100 ${srcdir}/gpl.texi \
101 ${srcdir}/screen.texi \
102 ${srcdir}/commands.texi \
103 ${srcdir}/entering.texi \
104 ${srcdir}/basic.texi \
105 ${srcdir}/mini.texi \
106 ${srcdir}/m-x.texi \
107 ${srcdir}/help.texi \
108 ${srcdir}/mark.texi \
109 ${srcdir}/killing.texi \
110 ${srcdir}/regs.texi \
111 ${srcdir}/display.texi \
112 ${srcdir}/search.texi \
113 ${srcdir}/fixit.texi \
114 ${srcdir}/files.texi \
115 ${srcdir}/buffers.texi \
116 ${srcdir}/windows.texi \
117 ${srcdir}/frames.texi \
118 ${srcdir}/mule.texi \
119 ${srcdir}/modes.texi \
120 ${srcdir}/indent.texi \
121 ${srcdir}/text.texi \
122 ${srcdir}/programs.texi \
123 ${srcdir}/building.texi \
124 ${srcdir}/maintaining.texi \
125 ${srcdir}/abbrevs.texi \
126 ${srcdir}/sending.texi \
127 ${srcdir}/rmail.texi \
128 ${srcdir}/dired.texi \
129 ${srcdir}/calendar.texi \
130 ${srcdir}/misc.texi \
131 ${srcdir}/package.texi \
132 ${srcdir}/custom.texi \
133 ${srcdir}/trouble.texi \
134 ${srcdir}/cmdargs.texi \
135 ${srcdir}/xresources.texi \
136 ${srcdir}/anti.texi \
137 ${srcdir}/macos.texi \
138 ${srcdir}/msdos.texi \
139 ${srcdir}/gnu.texi \
140 ${srcdir}/glossary.texi \
141 ${srcdir}/ack.texi \
142 ${srcdir}/kmacro.texi \
143 $(EMACS_XTRA)
145 ## Disable implicit rules.
146 %.texi: ;
148 .PHONY: info dvi html pdf ps
150 info: $(buildinfodir)/emacs.info
151 dvi: $(DVI_TARGETS)
152 html: $(HTML_TARGETS)
153 pdf: $(PDF_TARGETS)
154 ps: $(PS_TARGETS)
156 ## The info/ directory exists in release tarfiles but not the repository.
157 ${buildinfodir}:
158 ${MKDIR_P} $@
160 # Note that all the Info targets build the Info files in srcdir.
161 # There is no provision for Info files to exist in the build directory.
162 # In a distribution of Emacs, the Info files should be up to date.
163 $(buildinfodir)/emacs.info: ${EMACSSOURCES} | ${buildinfodir}
164 $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
166 emacs.dvi: ${EMACSSOURCES}
167 $(ENVADD) $(TEXI2DVI) $<
169 emacs.pdf: ${EMACSSOURCES}
170 $(ENVADD) $(TEXI2PDF) $<
172 emacs.html: ${EMACSSOURCES}
173 $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ $<
175 emacs-xtra.dvi: $(EMACS_XTRA)
176 $(ENVADD) $(TEXI2DVI) $<
178 emacs-xtra.pdf: $(EMACS_XTRA)
179 $(ENVADD) $(TEXI2PDF) $<
181 %.ps: %.dvi
182 $(DVIPS) -o $@ $<
184 .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean infoclean
186 ## Temp files.
187 mostlyclean:
188 rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \
189 *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs
191 ## Products not in the release tarfiles.
192 clean: mostlyclean
193 rm -f $(DVI_TARGETS) $(HTML_TARGETS) $(PDF_TARGETS) $(PS_TARGETS)
194 rm -f emacs-manual-${version}.tar*
196 distclean: clean
197 rm -f Makefile
199 ## In the standalone tarfile, the clean rule runs this.
200 infoclean:
201 rm -f \
202 $(buildinfodir)/emacs.info \
203 $(buildinfodir)/emacs.info-[1-9] \
204 $(buildinfodir)/emacs.info-[1-9][0-9]
206 bootstrap-clean maintainer-clean: distclean infoclean
208 .PHONY: dist
210 ## Make a standalone tarfile of the Emacs manual sources.
211 ## The [c] is a dumb way to prevent configure expanding it.
212 ## TODO this is getting increasingly lengthy; not sure it is worth keeping.
213 dist:
214 rm -rf emacs-manual-${version}
215 mkdir emacs-manual-${version}
216 cp ${srcdir}/*.texi ${texinfodir}/texinfo.tex \
217 ${srcdir}/ChangeLog* emacs-manual-${version}/
218 sed -e 's/@sr[c]dir@/./' -e 's/^\(texinfodir *=\).*/\1 ./' \
219 -e 's/^\(buildinfodir *=\).*/\1 ./' \
220 -e 's/^\(clean:.*\)/\1 infoclean/' \
221 -e "s/@ver[s]ion@/${version}/" \
222 -e 's/@MAKE[I]NFO@/makeinfo/' -e 's/@MK[D]IR_P@/mkdir -p/' \
223 -e 's/@IN[F]O_EXT@/.info/' -e 's/@IN[F]O_OPTS@//' \
224 -e 's|@SH[E]LL@|/bin/bash|' \
225 -e 's|@[p]refix@|/usr/local|' \
226 -e 's|@[d]atarootdir@|$${prefix}/share|' \
227 -e 's|@[d]atadir@|$${datarootdir}|' \
228 -e 's|@[P]ACKAGE_TARNAME@|emacs|' \
229 -e 's|@[d]ocdir@|$${datarootdir}/doc/$${PACKAGE_TARNAME}|' \
230 -e 's|@[d]vidir@|$${docdir}|' \
231 -e 's|@[h]tmldir@|$${docdir}|' \
232 -e 's|@[p]dfdir@|$${docdir}|' \
233 -e 's|@[p]sdir@|$${docdir}|' \
234 -e 's|@[G]ZIP_PROG@|gzip|' \
235 -e 's|@IN[S]TALL@|install -c|' \
236 -e 's|@IN[S]TALL_DATA@|$${INSTALL} -m 644|' \
237 -e '/@[c]onfigure_input@/d' \
238 ${srcdir}/Makefile.in > emacs-manual-${version}/Makefile
239 @if grep '@[a-zA-Z_]*@' emacs-manual-${version}/Makefile; then \
240 echo "Unexpanded configure variables in Makefile?" 1>&2; exit 1; \
242 tar -cf emacs-manual-${version}.tar emacs-manual-${version}
243 rm -rf emacs-manual-${version}
246 .PHONY: install-dvi install-html install-pdf install-ps install-doc
248 install-dvi: dvi
249 umask 022; $(MKDIR_P) "$(DESTDIR)$(dvidir)"
250 $(INSTALL_DATA) $(DVI_TARGETS) "$(DESTDIR)$(dvidir)"
251 install-html: html
252 umask 022; $(MKDIR_P) "$(DESTDIR)$(htmldir)"
253 $(INSTALL_DATA) $(HTML_TARGETS) "$(DESTDIR)$(htmldir)"
254 install-pdf: pdf
255 umask 022;$(MKDIR_P) "$(DESTDIR)$(pdfdir)"
256 $(INSTALL_DATA) $(PDF_TARGETS) "$(DESTDIR)$(pdfdir)"
257 install-ps: ps
258 umask 022; $(MKDIR_P) "$(DESTDIR)$(psdir)"
259 for file in $(PS_TARGETS); do \
260 $(INSTALL_DATA) $${file} "$(DESTDIR)$(psdir)"; \
261 [ -n "${GZIP_PROG}" ] || continue; \
262 rm -f "$(DESTDIR)$(psdir)/$${file}.gz"; \
263 ${GZIP_PROG} -9n "$(DESTDIR)$(psdir)/$${file}"; \
264 done
266 ## Top-level Makefile installs the info pages.
267 install-doc: install-dvi install-html install-pdf install-ps
270 .PHONY: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps uninstall-doc
272 uninstall-dvi:
273 for file in $(DVI_TARGETS); do \
274 rm -f "$(DESTDIR)$(dvidir)/$${file}"; \
275 done
276 uninstall-html:
277 for file in $(HTML_TARGETS); do \
278 rm -f "$(DESTDIR)$(htmldir)/$${file}"; \
279 done
280 uninstall-ps:
281 ext= ; [ -n "${GZIP_PROG}" ] && ext=.gz; \
282 for file in $(PS_TARGETS); do \
283 rm -f "$(DESTDIR)$(psdir)/$${file}$${ext}"; \
284 done
285 uninstall-pdf:
286 for file in $(PDF_TARGETS); do \
287 rm -f "$(DESTDIR)$(pdfdir)/$${file}"; \
288 done
290 uninstall-doc: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps
293 ### Makefile ends here