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