Set the version number in the texinfo manuals using configure.
[bpt/emacs.git] / doc / emacs / Makefile.in
CommitLineData
df42eec6 1#### Makefile for the Emacs Manual
8cf51b2c
GM
2
3# Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
5f874327
GM
4# 2004, 2005, 2006, 2007, 2008, 2009, 2010
5# Free Software Foundation, Inc.
8cf51b2c
GM
6
7# This file is part of GNU Emacs.
8
352c8b4a 9# GNU Emacs is free software: you can redistribute it and/or modify
8cf51b2c 10# it under the terms of the GNU General Public License as published by
352c8b4a
GM
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
8cf51b2c
GM
13
14# GNU Emacs is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18
19# You should have received a copy of the GNU General Public License
352c8b4a
GM
20# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
0264072d 22SHELL = /bin/sh
8cf51b2c 23
4c83f6e1
GM
24# Where to find the source code. $(srcdir) will be the doc/emacs subdirectory
25# of the source tree. This is set by configure's `--srcdir' option.
8cf51b2c 26srcdir=@srcdir@
8cf51b2c
GM
27
28# Tell make where to find source files; this is needed for the makefiles.
29VPATH=@srcdir@
30
17ca7950
GM
31# Only for make dist.
32version=@version@
33
df42eec6
GM
34## Where the output files go.
35## Note that the setfilename command in the .texi files assumes this.
ea274122
GM
36## This is a bit funny. Because the info files are in the
37## distribution tarfiles, they are always made in $scrdir/../../info,
38## even for out-of-tree builds. So infodir is really relative to srcdir.
39## The use of VPATH makes it work out, but why not set
40## infodir = $(srcdir)/../../info and make it explicit?
df42eec6 41infodir=../../info
2358ae54
GM
42# Directory with the (customized) texinfo.tex file.
43texinfodir = $(srcdir)/../misc
8cf51b2c
GM
44
45# The makeinfo program is part of the Texinfo distribution.
46# Use --force so that it generates output even if there are errors.
47MAKEINFO = makeinfo --force
df42eec6 48
df42eec6 49TEXI2DVI = texi2dvi
703d26ba 50TEXI2PDF = texi2pdf
8cf51b2c
GM
51
52# The following rule does not work with all versions of `make'.
53.SUFFIXES: .texi .dvi
54.texi.dvi:
df42eec6 55 $(TEXI2DVI) $<
8cf51b2c 56
2358ae54 57ENVADD = TEXINPUTS="$(srcdir):$(texinfodir):$(TEXINPUTS)" MAKEINFO="$(MAKEINFO) -I$(srcdir)"
8cf51b2c 58
df42eec6 59
4c83f6e1
GM
60EMACS_XTRA= \
61 ${srcdir}/emacs-xtra.texi \
8cf51b2c
GM
62 $(srcdir)/arevert-xtra.texi \
63 $(srcdir)/cal-xtra.texi \
64 $(srcdir)/dired-xtra.texi \
65 $(srcdir)/picture-xtra.texi \
66 $(srcdir)/emerge-xtra.texi \
67 $(srcdir)/vc-xtra.texi \
68 $(srcdir)/vc1-xtra.texi \
8cf51b2c
GM
69 $(srcdir)/fortran-xtra.texi \
70 $(srcdir)/msdog-xtra.texi
71
72EMACSSOURCES= \
73 ${srcdir}/emacs.texi \
74 ${srcdir}/doclicense.texi \
75 ${srcdir}/gpl.texi \
76 ${srcdir}/screen.texi \
77 ${srcdir}/commands.texi \
78 ${srcdir}/entering.texi \
79 ${srcdir}/basic.texi \
80 ${srcdir}/mini.texi \
81 ${srcdir}/m-x.texi \
82 ${srcdir}/help.texi \
83 ${srcdir}/mark.texi \
84 ${srcdir}/killing.texi \
85 ${srcdir}/regs.texi \
86 ${srcdir}/display.texi \
87 ${srcdir}/search.texi \
88 ${srcdir}/fixit.texi \
89 ${srcdir}/files.texi \
90 ${srcdir}/buffers.texi \
91 ${srcdir}/windows.texi \
92 ${srcdir}/frames.texi \
93 ${srcdir}/mule.texi \
94 ${srcdir}/major.texi \
95 ${srcdir}/indent.texi \
96 ${srcdir}/text.texi \
97 ${srcdir}/programs.texi \
98 ${srcdir}/building.texi \
99 ${srcdir}/maintaining.texi \
100 ${srcdir}/abbrevs.texi \
101 ${srcdir}/sending.texi \
102 ${srcdir}/rmail.texi \
103 ${srcdir}/dired.texi \
104 ${srcdir}/calendar.texi \
105 ${srcdir}/misc.texi \
106 ${srcdir}/custom.texi \
107 ${srcdir}/trouble.texi \
108 ${srcdir}/cmdargs.texi \
109 ${srcdir}/xresources.texi \
110 ${srcdir}/anti.texi \
111 ${srcdir}/macos.texi \
112 ${srcdir}/msdog.texi \
113 ${srcdir}/gnu.texi \
114 ${srcdir}/glossary.texi \
115 ${srcdir}/ack.texi \
116 ${srcdir}/kmacro.texi \
117 $(EMACS_XTRA)
118
ea274122
GM
119.PHONY: info dvi pdf
120
0264072d 121info: $(infodir)/emacs
8cf51b2c 122
df42eec6 123$(infodir):
8a944cea 124 mkdir $@ || test -d $@
8cf51b2c 125
0264072d
GM
126dvi: emacs.dvi
127pdf: emacs.pdf
8cf51b2c 128
0264072d
GM
129# Note that all the Info targets build the Info files in srcdir.
130# There is no provision for Info files to exist in the build directory.
8cf51b2c
GM
131# In a distribution of Emacs, the Info files should be up to date.
132
0264072d
GM
133$(infodir)/emacs: $(infodir) ${EMACSSOURCES}
134 cd $(srcdir); $(MAKEINFO) emacs.texi -o $@
8cf51b2c
GM
135
136emacs.dvi: ${EMACSSOURCES}
137 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi
138
703d26ba
GM
139emacs.pdf: ${EMACSSOURCES}
140 $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs.texi
141
8cf51b2c 142
4c83f6e1 143emacs-xtra.dvi: $(EMACS_XTRA)
8cf51b2c
GM
144 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi
145
4c83f6e1 146emacs-xtra.pdf: $(EMACS_XTRA)
703d26ba
GM
147 $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs-xtra.texi
148
4c83f6e1 149.PHONY: mostlyclean clean distclean maintainer-clean infoclean
8cf51b2c 150
4c83f6e1 151## Temp files.
8cf51b2c 152mostlyclean:
4c83f6e1
GM
153 rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \
154 *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs
8cf51b2c 155
4c83f6e1 156## Products not in the release tarfiles.
8cf51b2c 157clean: mostlyclean
4c83f6e1 158 rm -f emacs.dvi emacs-xtra.dvi emacs.pdf emacs-xtra.pdf
17ca7950 159 rm -f emacs-manual-${version}.tar*
8cf51b2c
GM
160
161distclean: clean
f7a31f11 162 rm -f emacsver.texi
8cf51b2c 163
4c83f6e1
GM
164## In the standalone tarfile, the clean rule runs this.
165infoclean:
0264072d 166 -cd $(infodir) && rm -f emacs emacs-[1-9] emacs-[1-9][0-9]
df42eec6 167
4c83f6e1
GM
168maintainer-clean: distclean infoclean
169
ea274122
GM
170.PHONY: dist
171
4c83f6e1
GM
172## Make a standalone tarfile of the Emacs manual sources.
173## The [c] is a dumb way to prevent configure expanding it.
4c83f6e1 174dist:
17ca7950
GM
175 rm -rf emacs-manual-${version}
176 mkdir emacs-manual-${version}
4c83f6e1 177 cp ${srcdir}/*.texi ${texinfodir}/texinfo.tex \
17ca7950 178 ${srcdir}/ChangeLog* emacs-manual-${version}/
4c83f6e1 179 sed -e 's/@sr[c]dir@/./' -e 's/\(texinfodir *=\).*/\1 ./' \
ea274122 180 -e 's/\(infodir *=\).*/\1 ./' -e 's/^\(clean:.*\)/\1 infoclean/' \
17ca7950
GM
181 -e "s/@ver[s]ion@/${version}/" \
182 ${srcdir}/Makefile.in > emacs-manual-${version}/Makefile
f7a31f11
GM
183 sed -e "s/@ver[s]ion@/${version}/" \
184 ${srcdir}/emacsver.texi.in > emacs-manual-${version}/emacsver.texi
17ca7950
GM
185 tar -cf emacs-manual-${version}.tar emacs-manual-${version}
186 rm -rf emacs-manual-${version}
4c83f6e1 187
df42eec6 188### Makefile ends here