Anchor regexps in doc/ `make dist' rules.
[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 \
eef3ab94 74 ${srcdir}/emacsver.texi \
8cf51b2c
GM
75 ${srcdir}/doclicense.texi \
76 ${srcdir}/gpl.texi \
77 ${srcdir}/screen.texi \
78 ${srcdir}/commands.texi \
79 ${srcdir}/entering.texi \
80 ${srcdir}/basic.texi \
81 ${srcdir}/mini.texi \
82 ${srcdir}/m-x.texi \
83 ${srcdir}/help.texi \
84 ${srcdir}/mark.texi \
85 ${srcdir}/killing.texi \
86 ${srcdir}/regs.texi \
87 ${srcdir}/display.texi \
88 ${srcdir}/search.texi \
89 ${srcdir}/fixit.texi \
90 ${srcdir}/files.texi \
91 ${srcdir}/buffers.texi \
92 ${srcdir}/windows.texi \
93 ${srcdir}/frames.texi \
94 ${srcdir}/mule.texi \
95 ${srcdir}/major.texi \
96 ${srcdir}/indent.texi \
97 ${srcdir}/text.texi \
98 ${srcdir}/programs.texi \
99 ${srcdir}/building.texi \
100 ${srcdir}/maintaining.texi \
101 ${srcdir}/abbrevs.texi \
102 ${srcdir}/sending.texi \
103 ${srcdir}/rmail.texi \
104 ${srcdir}/dired.texi \
105 ${srcdir}/calendar.texi \
106 ${srcdir}/misc.texi \
107 ${srcdir}/custom.texi \
108 ${srcdir}/trouble.texi \
109 ${srcdir}/cmdargs.texi \
110 ${srcdir}/xresources.texi \
111 ${srcdir}/anti.texi \
112 ${srcdir}/macos.texi \
113 ${srcdir}/msdog.texi \
114 ${srcdir}/gnu.texi \
115 ${srcdir}/glossary.texi \
116 ${srcdir}/ack.texi \
117 ${srcdir}/kmacro.texi \
118 $(EMACS_XTRA)
119
abd40fb4
GM
120## This seems pointless. The info/ directory exists in both the
121## repository and the release tarfiles. We do not use any
122## equivalent of mkdir -p/mkinstalldirs, so this is not a general
123## solution anyway. The second test -d is for parallel builds.
5bd23485 124mkinfodir = @cd ${srcdir}; test -d ${infodir} || mkdir ${infodir} || test -d ${infodir}
abd40fb4 125
ea274122
GM
126.PHONY: info dvi pdf
127
0264072d 128info: $(infodir)/emacs
0264072d
GM
129dvi: emacs.dvi
130pdf: emacs.pdf
8cf51b2c 131
0264072d
GM
132# Note that all the Info targets build the Info files in srcdir.
133# There is no provision for Info files to exist in the build directory.
8cf51b2c
GM
134# In a distribution of Emacs, the Info files should be up to date.
135
abd40fb4
GM
136$(infodir)/emacs: ${EMACSSOURCES}
137 $(mkinfodir)
eef3ab94 138 cd $(srcdir); $(MAKEINFO) $< -o $@
8cf51b2c
GM
139
140emacs.dvi: ${EMACSSOURCES}
eef3ab94 141 $(ENVADD) $(TEXI2DVI) $<
8cf51b2c 142
703d26ba 143emacs.pdf: ${EMACSSOURCES}
eef3ab94 144 $(ENVADD) $(TEXI2PDF) $<
703d26ba 145
8cf51b2c 146
4c83f6e1 147emacs-xtra.dvi: $(EMACS_XTRA)
eef3ab94 148 $(ENVADD) $(TEXI2DVI) $<
8cf51b2c 149
4c83f6e1 150emacs-xtra.pdf: $(EMACS_XTRA)
eef3ab94 151 $(ENVADD) $(TEXI2PDF) $<
703d26ba 152
4c83f6e1 153.PHONY: mostlyclean clean distclean maintainer-clean infoclean
8cf51b2c 154
4c83f6e1 155## Temp files.
8cf51b2c 156mostlyclean:
4c83f6e1
GM
157 rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \
158 *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs
8cf51b2c 159
4c83f6e1 160## Products not in the release tarfiles.
8cf51b2c 161clean: mostlyclean
4c83f6e1 162 rm -f emacs.dvi emacs-xtra.dvi emacs.pdf emacs-xtra.pdf
17ca7950 163 rm -f emacs-manual-${version}.tar*
8cf51b2c
GM
164
165distclean: clean
166
4c83f6e1
GM
167## In the standalone tarfile, the clean rule runs this.
168infoclean:
aa9db089 169 -cd $(srcdir) && cd $(infodir) && rm -f emacs emacs-[1-9] emacs-[1-9][0-9]
df42eec6 170
4c83f6e1
GM
171maintainer-clean: distclean infoclean
172
ea274122
GM
173.PHONY: dist
174
4c83f6e1
GM
175## Make a standalone tarfile of the Emacs manual sources.
176## The [c] is a dumb way to prevent configure expanding it.
4c83f6e1 177dist:
17ca7950
GM
178 rm -rf emacs-manual-${version}
179 mkdir emacs-manual-${version}
4c83f6e1 180 cp ${srcdir}/*.texi ${texinfodir}/texinfo.tex \
17ca7950 181 ${srcdir}/ChangeLog* emacs-manual-${version}/
4393405b
GM
182 sed -e 's/@sr[c]dir@/./' -e 's/^\(texinfodir *=\).*/\1 ./' \
183 -e 's/^\(infodir *=\).*/\1 ./' -e 's/^\(clean:.*\)/\1 infoclean/' \
17ca7950
GM
184 -e "s/@ver[s]ion@/${version}/" \
185 ${srcdir}/Makefile.in > emacs-manual-${version}/Makefile
186 tar -cf emacs-manual-${version}.tar emacs-manual-${version}
187 rm -rf emacs-manual-${version}
4c83f6e1 188
df42eec6 189### Makefile ends here