Commit | Line | Data |
---|---|---|
df42eec6 | 1 | #### Makefile for the Emacs Manual |
8cf51b2c | 2 | |
f48a9cb4 | 3 | # Copyright (C) 1994, 1996-2012 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 | 20 | SHELL = /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 | 24 | srcdir=@srcdir@ |
8cf51b2c | 25 | |
17ca7950 GM |
26 | # Only for make dist. |
27 | version=@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. |
34 | infodir = $(srcdir)/../../info | |
2358ae54 GM |
35 | # Directory with the (customized) texinfo.tex file. |
36 | texinfodir = $(srcdir)/../misc | |
8cf51b2c | 37 | |
8045b906 GM |
38 | INFO_EXT=@INFO_EXT@ |
39 | # Options used only when making info output. | |
40 | # --no-split is only needed because of MS-DOS. | |
41 | # For a possible alternative, see | |
42 | # http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01182.html | |
43 | INFO_OPTS=@INFO_OPTS@ | |
44 | ||
8cf51b2c GM |
45 | # The makeinfo program is part of the Texinfo distribution. |
46 | # Use --force so that it generates output even if there are errors. | |
45eb2a5d | 47 | MAKEINFO = @MAKEINFO@ |
6446548e | 48 | MAKEINFO_OPTS = --force --enable-encoding -I $(srcdir) |
df42eec6 | 49 | |
df42eec6 | 50 | TEXI2DVI = texi2dvi |
703d26ba | 51 | TEXI2PDF = texi2pdf |
c12e4a81 | 52 | DVIPS = dvips |
8cf51b2c | 53 | |
8cf51b2c | 54 | |
45eb2a5d WL |
55 | ENVADD = TEXINPUTS="$(srcdir):$(texinfodir):$(TEXINPUTS)" \ |
56 | MAKEINFO="$(MAKEINFO) $(MAKEINFO_OPTS)" | |
8cf51b2c | 57 | |
df42eec6 | 58 | |
4c83f6e1 GM |
59 | EMACS_XTRA= \ |
60 | ${srcdir}/emacs-xtra.texi \ | |
8cf51b2c GM |
61 | $(srcdir)/arevert-xtra.texi \ |
62 | $(srcdir)/cal-xtra.texi \ | |
63 | $(srcdir)/dired-xtra.texi \ | |
64 | $(srcdir)/picture-xtra.texi \ | |
65 | $(srcdir)/emerge-xtra.texi \ | |
66 | $(srcdir)/vc-xtra.texi \ | |
67 | $(srcdir)/vc1-xtra.texi \ | |
8cf51b2c GM |
68 | $(srcdir)/fortran-xtra.texi \ |
69 | $(srcdir)/msdog-xtra.texi | |
70 | ||
71 | EMACSSOURCES= \ | |
72 | ${srcdir}/emacs.texi \ | |
eef3ab94 | 73 | ${srcdir}/emacsver.texi \ |
8cf51b2c GM |
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 \ | |
8875da1e | 94 | ${srcdir}/modes.texi \ |
8cf51b2c GM |
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 \ | |
d43f5a42 | 106 | ${srcdir}/package.texi \ |
8cf51b2c GM |
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 | |
8cc1d519 | 122 | ## equivalent of mkdir -p/install-sh -d, so this is not a general |
abd40fb4 | 123 | ## solution anyway. The second test -d is for parallel builds. |
c1dc72b3 | 124 | mkinfodir = @test -d ${infodir} || mkdir ${infodir} || test -d ${infodir} |
abd40fb4 | 125 | |
234db610 | 126 | .PHONY: info dvi html pdf ps |
ea274122 | 127 | |
8045b906 | 128 | info: $(infodir)/emacs$(INFO_EXT) |
0264072d | 129 | dvi: emacs.dvi |
234db610 | 130 | html: emacs.html |
0264072d | 131 | pdf: emacs.pdf |
c12e4a81 | 132 | ps: emacs.ps |
8cf51b2c | 133 | |
0264072d GM |
134 | # Note that all the Info targets build the Info files in srcdir. |
135 | # There is no provision for Info files to exist in the build directory. | |
8cf51b2c | 136 | # In a distribution of Emacs, the Info files should be up to date. |
f48a9cb4 | 137 | # Note: "<" is not portable in ordinary make rules. |
8045b906 | 138 | $(infodir)/emacs$(INFO_EXT): ${EMACSSOURCES} |
abd40fb4 | 139 | $(mkinfodir) |
8045b906 | 140 | $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/emacs.texi |
8cf51b2c GM |
141 | |
142 | emacs.dvi: ${EMACSSOURCES} | |
f48a9cb4 | 143 | $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi |
8cf51b2c | 144 | |
c12e4a81 | 145 | emacs.ps: emacs.dvi |
f48a9cb4 | 146 | $(DVIPS) -o $@ emacs.dvi |
c12e4a81 | 147 | |
703d26ba | 148 | emacs.pdf: ${EMACSSOURCES} |
f48a9cb4 | 149 | $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs.texi |
703d26ba | 150 | |
234db610 | 151 | emacs.html: ${EMACSSOURCES} |
f48a9cb4 | 152 | $(MAKEINFO) $(MAKEINFO_OPTS) --html -o $@ ${srcdir}/emacs.texi |
8cf51b2c | 153 | |
4c83f6e1 | 154 | emacs-xtra.dvi: $(EMACS_XTRA) |
f48a9cb4 | 155 | $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi |
8cf51b2c | 156 | |
c12e4a81 | 157 | emacs-xtra.ps: emacs-xtra.dvi |
f48a9cb4 | 158 | $(DVIPS) -o $@ emacs-xtra.dvi |
c12e4a81 | 159 | |
4c83f6e1 | 160 | emacs-xtra.pdf: $(EMACS_XTRA) |
f48a9cb4 | 161 | $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs-xtra.texi |
703d26ba | 162 | |
4c83f6e1 | 163 | .PHONY: mostlyclean clean distclean maintainer-clean infoclean |
8cf51b2c | 164 | |
4c83f6e1 | 165 | ## Temp files. |
8cf51b2c | 166 | mostlyclean: |
4c83f6e1 GM |
167 | rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \ |
168 | *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs | |
8cf51b2c | 169 | |
4c83f6e1 | 170 | ## Products not in the release tarfiles. |
8cf51b2c | 171 | clean: mostlyclean |
c12e4a81 GM |
172 | rm -f emacs.dvi emacs-xtra.dvi emacs.pdf emacs-xtra.pdf \ |
173 | emacs.ps emacs-xtra.ps | |
234db610 | 174 | rm -rf emacs.html/ |
17ca7950 | 175 | rm -f emacs-manual-${version}.tar* |
8cf51b2c GM |
176 | |
177 | distclean: clean | |
178 | ||
4c83f6e1 GM |
179 | ## In the standalone tarfile, the clean rule runs this. |
180 | infoclean: | |
8045b906 | 181 | -cd $(infodir) && rm -f emacs$(INFO_EXT) emacs$(INFO_EXT)-[1-9] emacs$(INFO_EXT)-[1-9][0-9] |
df42eec6 | 182 | |
4c83f6e1 GM |
183 | maintainer-clean: distclean infoclean |
184 | ||
ea274122 GM |
185 | .PHONY: dist |
186 | ||
4c83f6e1 GM |
187 | ## Make a standalone tarfile of the Emacs manual sources. |
188 | ## The [c] is a dumb way to prevent configure expanding it. | |
4c83f6e1 | 189 | dist: |
17ca7950 GM |
190 | rm -rf emacs-manual-${version} |
191 | mkdir emacs-manual-${version} | |
4c83f6e1 | 192 | cp ${srcdir}/*.texi ${texinfodir}/texinfo.tex \ |
17ca7950 | 193 | ${srcdir}/ChangeLog* emacs-manual-${version}/ |
4393405b GM |
194 | sed -e 's/@sr[c]dir@/./' -e 's/^\(texinfodir *=\).*/\1 ./' \ |
195 | -e 's/^\(infodir *=\).*/\1 ./' -e 's/^\(clean:.*\)/\1 infoclean/' \ | |
17ca7950 GM |
196 | -e "s/@ver[s]ion@/${version}/" \ |
197 | ${srcdir}/Makefile.in > emacs-manual-${version}/Makefile | |
198 | tar -cf emacs-manual-${version}.tar emacs-manual-${version} | |
199 | rm -rf emacs-manual-${version} | |
4c83f6e1 | 200 | |
df42eec6 | 201 | ### Makefile ends here |