Update copyright year to 2014 by running admin/update-copyright.
[emacs.git] / doc / emacs / Makefile.in
blob4a59ebed52181df27abffcf1d3754f88d49a8571
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 INFO_EXT=@INFO_EXT@
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 # http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01182.html
62 INFO_OPTS=@INFO_OPTS@
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
77 ENVADD = TEXINPUTS="$(srcdir):$(texinfodir):$(TEXINPUTS)" \
78 MAKEINFO="$(MAKEINFO) $(MAKEINFO_OPTS)"
80 DVI_TARGETS = emacs.dvi emacs-xtra.dvi
81 HTML_TARGETS = emacs.html
82 PDF_TARGETS = emacs.pdf emacs-xtra.pdf
83 PS_TARGETS = emacs.ps emacs-xtra.ps
85 EMACS_XTRA= \
86 ${srcdir}/emacs-xtra.texi \
87 $(srcdir)/arevert-xtra.texi \
88 $(srcdir)/cal-xtra.texi \
89 $(srcdir)/dired-xtra.texi \
90 $(srcdir)/picture-xtra.texi \
91 $(srcdir)/emerge-xtra.texi \
92 $(srcdir)/vc-xtra.texi \
93 $(srcdir)/vc1-xtra.texi \
94 $(srcdir)/fortran-xtra.texi \
95 $(srcdir)/msdog-xtra.texi
97 EMACSSOURCES= \
98 ${srcdir}/emacs.texi \
99 ${srcdir}/emacsver.texi \
100 ${srcdir}/doclicense.texi \
101 ${srcdir}/gpl.texi \
102 ${srcdir}/screen.texi \
103 ${srcdir}/commands.texi \
104 ${srcdir}/entering.texi \
105 ${srcdir}/basic.texi \
106 ${srcdir}/mini.texi \
107 ${srcdir}/m-x.texi \
108 ${srcdir}/help.texi \
109 ${srcdir}/mark.texi \
110 ${srcdir}/killing.texi \
111 ${srcdir}/regs.texi \
112 ${srcdir}/display.texi \
113 ${srcdir}/search.texi \
114 ${srcdir}/fixit.texi \
115 ${srcdir}/files.texi \
116 ${srcdir}/buffers.texi \
117 ${srcdir}/windows.texi \
118 ${srcdir}/frames.texi \
119 ${srcdir}/mule.texi \
120 ${srcdir}/modes.texi \
121 ${srcdir}/indent.texi \
122 ${srcdir}/text.texi \
123 ${srcdir}/programs.texi \
124 ${srcdir}/building.texi \
125 ${srcdir}/maintaining.texi \
126 ${srcdir}/abbrevs.texi \
127 ${srcdir}/sending.texi \
128 ${srcdir}/rmail.texi \
129 ${srcdir}/dired.texi \
130 ${srcdir}/calendar.texi \
131 ${srcdir}/misc.texi \
132 ${srcdir}/package.texi \
133 ${srcdir}/custom.texi \
134 ${srcdir}/trouble.texi \
135 ${srcdir}/cmdargs.texi \
136 ${srcdir}/xresources.texi \
137 ${srcdir}/anti.texi \
138 ${srcdir}/macos.texi \
139 ${srcdir}/msdog.texi \
140 ${srcdir}/gnu.texi \
141 ${srcdir}/glossary.texi \
142 ${srcdir}/ack.texi \
143 ${srcdir}/kmacro.texi \
144 $(EMACS_XTRA)
146 ## The info/ directory exists in release tarfiles but not the repository.
147 mkinfodir = @${MKDIR_P} ${buildinfodir}
149 .PHONY: info dvi html pdf ps
151 .SUFFIXES: .ps .dvi
153 .dvi.ps:
154 $(DVIPS) -o $@ $<
156 info: $(buildinfodir)/emacs$(INFO_EXT)
157 dvi: $(DVI_TARGETS)
158 html: $(HTML_TARGETS)
159 pdf: $(PDF_TARGETS)
160 ps: $(PS_TARGETS)
162 # Note that all the Info targets build the Info files in srcdir.
163 # There is no provision for Info files to exist in the build directory.
164 # In a distribution of Emacs, the Info files should be up to date.
165 # Note: "<" is not portable in ordinary make rules.
166 $(buildinfodir)/emacs$(INFO_EXT): ${EMACSSOURCES}
167 $(mkinfodir)
168 $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/emacs.texi
170 emacs.dvi: ${EMACSSOURCES}
171 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi
173 emacs.pdf: ${EMACSSOURCES}
174 $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs.texi
176 emacs.html: ${EMACSSOURCES}
177 $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/emacs.texi
179 emacs-xtra.dvi: $(EMACS_XTRA)
180 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi
182 emacs-xtra.pdf: $(EMACS_XTRA)
183 $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs-xtra.texi
185 .PHONY: mostlyclean clean distclean maintainer-clean infoclean
187 ## Temp files.
188 mostlyclean:
189 rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \
190 *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs
192 ## Products not in the release tarfiles.
193 clean: mostlyclean
194 rm -f $(DVI_TARGETS) $(HTML_TARGETS) $(PDF_TARGETS) $(PS_TARGETS)
195 rm -f emacs-manual-${version}.tar*
197 distclean: clean
198 rm -f Makefile
200 ## In the standalone tarfile, the clean rule runs this.
201 infoclean:
202 -cd $(buildinfodir) && rm -f emacs$(INFO_EXT) emacs$(INFO_EXT)-[1-9] emacs$(INFO_EXT)-[1-9][0-9]
204 maintainer-clean: distclean infoclean
206 .PHONY: dist
208 ## Make a standalone tarfile of the Emacs manual sources.
209 ## The [c] is a dumb way to prevent configure expanding it.
210 dist:
211 rm -rf emacs-manual-${version}
212 mkdir emacs-manual-${version}
213 cp ${srcdir}/*.texi ${texinfodir}/texinfo.tex \
214 ${srcdir}/ChangeLog* emacs-manual-${version}/
215 sed -e 's/@sr[c]dir@/./' -e 's/^\(texinfodir *=\).*/\1 ./' \
216 -e 's/^\(buildinfodir *=\).*/\1 ./' \
217 -e 's/^\(clean:.*\)/\1 infoclean/' \
218 -e "s/@ver[s]ion@/${version}/" \
219 -e 's/@MAKE[I]NFO@/makeinfo/' -e 's/@MK[D]IR_P@/mkdir -p/' \
220 -e 's/@IN[F]O_EXT@/.info/' -e 's/@IN[F]O_OPTS@//' \
221 ${srcdir}/Makefile.in > emacs-manual-${version}/Makefile
222 @if grep '@[a-zA-Z_]*@' emacs-manual-${version}/Makefile; then \
223 echo "Unexpanded configure variables in Makefile?" 1>&2; exit 1; \
225 tar -cf emacs-manual-${version}.tar emacs-manual-${version}
226 rm -rf emacs-manual-${version}
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