Commit | Line | Data |
---|---|---|
df42eec6 | 1 | #### Makefile for the Emacs Manual |
8cf51b2c | 2 | |
ab422c4d | 3 | # Copyright (C) 1994, 1996-2013 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 | |
789cf833 GM |
22 | # NB If you add any more configure variables, |
23 | # update the sed rules in the dist target below. | |
24 | ||
4c83f6e1 GM |
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. | |
8cf51b2c | 27 | srcdir=@srcdir@ |
8cf51b2c | 28 | |
17ca7950 GM |
29 | # Only for make dist. |
30 | version=@version@ | |
31 | ||
df42eec6 GM |
32 | ## Where the output files go. |
33 | ## Note that the setfilename command in the .texi files assumes this. | |
ea274122 GM |
34 | ## This is a bit funny. Because the info files are in the |
35 | ## distribution tarfiles, they are always made in $scrdir/../../info, | |
c1dc72b3 | 36 | ## even for out-of-tree builds. |
2fecccba | 37 | buildinfodir = $(srcdir)/../../info |
2358ae54 GM |
38 | # Directory with the (customized) texinfo.tex file. |
39 | texinfodir = $(srcdir)/../misc | |
8cf51b2c | 40 | |
3fe7cdc8 GM |
41 | MKDIR_P = @MKDIR_P@ |
42 | ||
8045b906 GM |
43 | INFO_EXT=@INFO_EXT@ |
44 | # Options used only when making info output. | |
45 | # --no-split is only needed because of MS-DOS. | |
46 | # For a possible alternative, see | |
47 | # http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01182.html | |
48 | INFO_OPTS=@INFO_OPTS@ | |
49 | ||
8cf51b2c GM |
50 | # The makeinfo program is part of the Texinfo distribution. |
51 | # Use --force so that it generates output even if there are errors. | |
45eb2a5d | 52 | MAKEINFO = @MAKEINFO@ |
6446548e | 53 | MAKEINFO_OPTS = --force --enable-encoding -I $(srcdir) |
df42eec6 | 54 | |
df42eec6 | 55 | TEXI2DVI = texi2dvi |
703d26ba | 56 | TEXI2PDF = texi2pdf |
c12e4a81 | 57 | DVIPS = dvips |
8cf51b2c | 58 | |
8cf51b2c | 59 | |
45eb2a5d WL |
60 | ENVADD = TEXINPUTS="$(srcdir):$(texinfodir):$(TEXINPUTS)" \ |
61 | MAKEINFO="$(MAKEINFO) $(MAKEINFO_OPTS)" | |
8cf51b2c | 62 | |
df42eec6 | 63 | |
4c83f6e1 GM |
64 | EMACS_XTRA= \ |
65 | ${srcdir}/emacs-xtra.texi \ | |
8cf51b2c GM |
66 | $(srcdir)/arevert-xtra.texi \ |
67 | $(srcdir)/cal-xtra.texi \ | |
68 | $(srcdir)/dired-xtra.texi \ | |
69 | $(srcdir)/picture-xtra.texi \ | |
70 | $(srcdir)/emerge-xtra.texi \ | |
71 | $(srcdir)/vc-xtra.texi \ | |
72 | $(srcdir)/vc1-xtra.texi \ | |
8cf51b2c GM |
73 | $(srcdir)/fortran-xtra.texi \ |
74 | $(srcdir)/msdog-xtra.texi | |
75 | ||
76 | EMACSSOURCES= \ | |
77 | ${srcdir}/emacs.texi \ | |
eef3ab94 | 78 | ${srcdir}/emacsver.texi \ |
8cf51b2c GM |
79 | ${srcdir}/doclicense.texi \ |
80 | ${srcdir}/gpl.texi \ | |
81 | ${srcdir}/screen.texi \ | |
82 | ${srcdir}/commands.texi \ | |
83 | ${srcdir}/entering.texi \ | |
84 | ${srcdir}/basic.texi \ | |
85 | ${srcdir}/mini.texi \ | |
86 | ${srcdir}/m-x.texi \ | |
87 | ${srcdir}/help.texi \ | |
88 | ${srcdir}/mark.texi \ | |
89 | ${srcdir}/killing.texi \ | |
90 | ${srcdir}/regs.texi \ | |
91 | ${srcdir}/display.texi \ | |
92 | ${srcdir}/search.texi \ | |
93 | ${srcdir}/fixit.texi \ | |
94 | ${srcdir}/files.texi \ | |
95 | ${srcdir}/buffers.texi \ | |
96 | ${srcdir}/windows.texi \ | |
97 | ${srcdir}/frames.texi \ | |
98 | ${srcdir}/mule.texi \ | |
8875da1e | 99 | ${srcdir}/modes.texi \ |
8cf51b2c GM |
100 | ${srcdir}/indent.texi \ |
101 | ${srcdir}/text.texi \ | |
102 | ${srcdir}/programs.texi \ | |
103 | ${srcdir}/building.texi \ | |
104 | ${srcdir}/maintaining.texi \ | |
105 | ${srcdir}/abbrevs.texi \ | |
106 | ${srcdir}/sending.texi \ | |
107 | ${srcdir}/rmail.texi \ | |
108 | ${srcdir}/dired.texi \ | |
109 | ${srcdir}/calendar.texi \ | |
110 | ${srcdir}/misc.texi \ | |
d43f5a42 | 111 | ${srcdir}/package.texi \ |
8cf51b2c GM |
112 | ${srcdir}/custom.texi \ |
113 | ${srcdir}/trouble.texi \ | |
114 | ${srcdir}/cmdargs.texi \ | |
115 | ${srcdir}/xresources.texi \ | |
116 | ${srcdir}/anti.texi \ | |
117 | ${srcdir}/macos.texi \ | |
118 | ${srcdir}/msdog.texi \ | |
119 | ${srcdir}/gnu.texi \ | |
120 | ${srcdir}/glossary.texi \ | |
121 | ${srcdir}/ack.texi \ | |
122 | ${srcdir}/kmacro.texi \ | |
123 | $(EMACS_XTRA) | |
124 | ||
abd40fb4 | 125 | ## This seems pointless. The info/ directory exists in both the |
3fe7cdc8 | 126 | ## repository and the release tarfiles. |
ac1a0ce1 | 127 | mkinfodir = @${MKDIR_P} ${buildinfodir} |
abd40fb4 | 128 | |
234db610 | 129 | .PHONY: info dvi html pdf ps |
ea274122 | 130 | |
ac1a0ce1 | 131 | info: $(buildinfodir)/emacs$(INFO_EXT) |
0264072d | 132 | dvi: emacs.dvi |
234db610 | 133 | html: emacs.html |
0264072d | 134 | pdf: emacs.pdf |
c12e4a81 | 135 | ps: emacs.ps |
8cf51b2c | 136 | |
0264072d GM |
137 | # Note that all the Info targets build the Info files in srcdir. |
138 | # There is no provision for Info files to exist in the build directory. | |
8cf51b2c | 139 | # In a distribution of Emacs, the Info files should be up to date. |
f48a9cb4 | 140 | # Note: "<" is not portable in ordinary make rules. |
ac1a0ce1 | 141 | $(buildinfodir)/emacs$(INFO_EXT): ${EMACSSOURCES} |
abd40fb4 | 142 | $(mkinfodir) |
8045b906 | 143 | $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/emacs.texi |
8cf51b2c GM |
144 | |
145 | emacs.dvi: ${EMACSSOURCES} | |
f48a9cb4 | 146 | $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi |
8cf51b2c | 147 | |
c12e4a81 | 148 | emacs.ps: emacs.dvi |
f48a9cb4 | 149 | $(DVIPS) -o $@ emacs.dvi |
c12e4a81 | 150 | |
703d26ba | 151 | emacs.pdf: ${EMACSSOURCES} |
f48a9cb4 | 152 | $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs.texi |
703d26ba | 153 | |
234db610 | 154 | emacs.html: ${EMACSSOURCES} |
f48a9cb4 | 155 | $(MAKEINFO) $(MAKEINFO_OPTS) --html -o $@ ${srcdir}/emacs.texi |
8cf51b2c | 156 | |
4c83f6e1 | 157 | emacs-xtra.dvi: $(EMACS_XTRA) |
f48a9cb4 | 158 | $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi |
8cf51b2c | 159 | |
c12e4a81 | 160 | emacs-xtra.ps: emacs-xtra.dvi |
f48a9cb4 | 161 | $(DVIPS) -o $@ emacs-xtra.dvi |
c12e4a81 | 162 | |
4c83f6e1 | 163 | emacs-xtra.pdf: $(EMACS_XTRA) |
f48a9cb4 | 164 | $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs-xtra.texi |
703d26ba | 165 | |
4c83f6e1 | 166 | .PHONY: mostlyclean clean distclean maintainer-clean infoclean |
8cf51b2c | 167 | |
4c83f6e1 | 168 | ## Temp files. |
8cf51b2c | 169 | mostlyclean: |
4c83f6e1 GM |
170 | rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \ |
171 | *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs | |
8cf51b2c | 172 | |
4c83f6e1 | 173 | ## Products not in the release tarfiles. |
8cf51b2c | 174 | clean: mostlyclean |
c12e4a81 GM |
175 | rm -f emacs.dvi emacs-xtra.dvi emacs.pdf emacs-xtra.pdf \ |
176 | emacs.ps emacs-xtra.ps | |
234db610 | 177 | rm -rf emacs.html/ |
17ca7950 | 178 | rm -f emacs-manual-${version}.tar* |
8cf51b2c GM |
179 | |
180 | distclean: clean | |
181 | ||
4c83f6e1 GM |
182 | ## In the standalone tarfile, the clean rule runs this. |
183 | infoclean: | |
ac1a0ce1 | 184 | -cd $(buildinfodir) && rm -f emacs$(INFO_EXT) emacs$(INFO_EXT)-[1-9] emacs$(INFO_EXT)-[1-9][0-9] |
df42eec6 | 185 | |
4c83f6e1 GM |
186 | maintainer-clean: distclean infoclean |
187 | ||
ea274122 GM |
188 | .PHONY: dist |
189 | ||
4c83f6e1 GM |
190 | ## Make a standalone tarfile of the Emacs manual sources. |
191 | ## The [c] is a dumb way to prevent configure expanding it. | |
4c83f6e1 | 192 | dist: |
17ca7950 GM |
193 | rm -rf emacs-manual-${version} |
194 | mkdir emacs-manual-${version} | |
4c83f6e1 | 195 | cp ${srcdir}/*.texi ${texinfodir}/texinfo.tex \ |
17ca7950 | 196 | ${srcdir}/ChangeLog* emacs-manual-${version}/ |
4393405b | 197 | sed -e 's/@sr[c]dir@/./' -e 's/^\(texinfodir *=\).*/\1 ./' \ |
2fecccba GM |
198 | -e 's/^\(buildinfodir *=\).*/\1 ./' \ |
199 | -e 's/^\(clean:.*\)/\1 infoclean/' \ | |
17ca7950 | 200 | -e "s/@ver[s]ion@/${version}/" \ |
789cf833 GM |
201 | -e 's/@MAKE[I]NFO@/makeinfo/' -e 's/@MK[D]IR_P@/mkdir -p/' \ |
202 | -e 's/@IN[F]O_EXT@/.info/' -e 's/@IN[F]O_OPTS@//' \ | |
17ca7950 | 203 | ${srcdir}/Makefile.in > emacs-manual-${version}/Makefile |
fc4893eb GM |
204 | @if grep '@[a-zA-Z_]*@' emacs-manual-${version}/Makefile; then \ |
205 | echo "Unexpanded configure variables in Makefile?" 1>&2; exit 1; \ | |
206 | fi | |
17ca7950 GM |
207 | tar -cf emacs-manual-${version}.tar emacs-manual-${version} |
208 | rm -rf emacs-manual-${version} | |
4c83f6e1 | 209 | |
df42eec6 | 210 | ### Makefile ends here |