1 #### Makefile for the Emacs Manual
3 # Copyright (C) 1994, 1996-2013 Free Software Foundation, Inc.
5 # This file is part of GNU Emacs.
7 # GNU Emacs is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
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.
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 # NB If you add any more configure variables,
23 # update the sed rules in the dist target below.
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.
32 ## Where the output files go.
33 ## Note that the setfilename command in the .texi files assumes this.
34 ## This is a bit funny. Because the info files are in the
35 ## distribution tarfiles, they are always made in $scrdir/../../info,
36 ## even for out-of-tree builds.
37 buildinfodir
= $(srcdir)/..
/..
/info
38 # Directory with the (customized) texinfo.tex file.
39 texinfodir
= $(srcdir)/..
/misc
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
50 # The makeinfo program is part of the Texinfo distribution.
51 # Use --force so that it generates output even if there are errors.
53 MAKEINFO_OPTS
= --force --enable-encoding
-I
$(srcdir)
60 ENVADD
= TEXINPUTS
="$(srcdir):$(texinfodir):$(TEXINPUTS)" \
61 MAKEINFO
="$(MAKEINFO) $(MAKEINFO_OPTS)"
65 ${srcdir}/emacs-xtra.texi \
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 \
73 $(srcdir)/fortran-xtra.texi \
74 $(srcdir)/msdog-xtra.texi
77 ${srcdir}/emacs.texi \
78 ${srcdir}/emacsver.texi \
79 ${srcdir}/doclicense.texi \
81 ${srcdir}/screen.texi \
82 ${srcdir}/commands.texi \
83 ${srcdir}/entering.texi \
84 ${srcdir}/basic.texi \
89 ${srcdir}/killing.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 \
99 ${srcdir}/modes.texi \
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 \
111 ${srcdir}/package.texi \
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 \
120 ${srcdir}/glossary.texi \
122 ${srcdir}/kmacro.texi \
125 ## This seems pointless. The info/ directory exists in both the
126 ## repository and the release tarfiles.
127 mkinfodir
= @
${MKDIR_P} ${buildinfodir}
129 .PHONY
: info dvi html pdf ps
131 info: $(buildinfodir
)/emacs
$(INFO_EXT
)
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.
139 # In a distribution of Emacs, the Info files should be up to date.
140 # Note: "<" is not portable in ordinary make rules.
141 $(buildinfodir
)/emacs
$(INFO_EXT
): ${EMACSSOURCES}
143 $(MAKEINFO
) $(MAKEINFO_OPTS
) $(INFO_OPTS
) -o
$@
${srcdir}/emacs.texi
145 emacs.
dvi: ${EMACSSOURCES}
146 $(ENVADD
) $(TEXI2DVI
) ${srcdir}/emacs.texi
149 $(DVIPS
) -o
$@ emacs.
dvi
151 emacs.pdf
: ${EMACSSOURCES}
152 $(ENVADD
) $(TEXI2PDF
) ${srcdir}/emacs.texi
154 emacs.html
: ${EMACSSOURCES}
155 $(MAKEINFO
) $(MAKEINFO_OPTS
) --html
-o
$@
${srcdir}/emacs.texi
157 emacs-xtra.
dvi: $(EMACS_XTRA
)
158 $(ENVADD
) $(TEXI2DVI
) ${srcdir}/emacs-xtra.texi
160 emacs-xtra.ps
: emacs-xtra.
dvi
161 $(DVIPS
) -o
$@ emacs-xtra.
dvi
163 emacs-xtra.pdf
: $(EMACS_XTRA
)
164 $(ENVADD
) $(TEXI2PDF
) ${srcdir}/emacs-xtra.texi
166 .PHONY
: mostlyclean clean distclean maintainer-clean infoclean
170 rm -f
*.aux
*.log
*.toc
*.cp
*.cps
*.fn
*.fns
*.ky
*.kys \
171 *.op
*.ops
*.pg
*.pgs
*.tp
*.tps
*.vr
*.vrs
173 ## Products not in the release tarfiles.
175 rm -f emacs.
dvi emacs-xtra.
dvi emacs.pdf emacs-xtra.pdf \
176 emacs.ps emacs-xtra.ps
178 rm -f emacs-manual-
${version}.
tar*
182 ## In the standalone tarfile, the clean rule runs this.
184 -cd
$(buildinfodir
) && rm -f emacs
$(INFO_EXT
) emacs
$(INFO_EXT
)-[1-9] emacs
$(INFO_EXT
)-[1-9][0-9]
186 maintainer-clean
: distclean infoclean
190 ## Make a standalone tarfile of the Emacs manual sources.
191 ## The [c] is a dumb way to prevent configure expanding it.
193 rm -rf emacs-manual-
${version}
194 mkdir emacs-manual-
${version}
195 cp
${srcdir}/*.texi
${texinfodir}/texinfo.
tex \
196 ${srcdir}/ChangeLog
* emacs-manual-
${version}/
197 sed
-e
's/@sr[c]dir@/./' -e
's/^\(texinfodir *=\).*/\1 ./' \
198 -e
's/^\(buildinfodir *=\).*/\1 ./' \
199 -e
's/^\(clean:.*\)/\1 infoclean/' \
200 -e
"s/@ver[s]ion@/${version}/" \
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@//' \
203 ${srcdir}/Makefile.in
> emacs-manual-
${version}/Makefile
204 tar -cf emacs-manual-
${version}.
tar emacs-manual-
${version}
205 @grep
'@[A-Z]*@' emacs-manual-
${version}/Makefile
&& \
206 echo
"WARNING: Unexpanded configure variables in Makefile?" || true
207 rm -rf emacs-manual-
${version}
209 ### Makefile ends here