| 1 | #### Makefile for the Emacs Manual |
| 2 | |
| 3 | # Copyright (C) 1994, 1996-2011 Free Software Foundation, Inc. |
| 4 | |
| 5 | # This file is part of GNU Emacs. |
| 6 | |
| 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. |
| 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 |
| 18 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 19 | |
| 20 | SHELL = /bin/sh |
| 21 | |
| 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. |
| 24 | srcdir=@srcdir@ |
| 25 | |
| 26 | # Only for make dist. |
| 27 | version=@version@ |
| 28 | |
| 29 | ## Where the output files go. |
| 30 | ## Note that the setfilename command in the .texi files assumes this. |
| 31 | ## This is a bit funny. Because the info files are in the |
| 32 | ## distribution tarfiles, they are always made in $scrdir/../../info, |
| 33 | ## even for out-of-tree builds. |
| 34 | infodir = $(srcdir)/../../info |
| 35 | # Directory with the (customized) texinfo.tex file. |
| 36 | texinfodir = $(srcdir)/../misc |
| 37 | |
| 38 | # The makeinfo program is part of the Texinfo distribution. |
| 39 | # Use --force so that it generates output even if there are errors. |
| 40 | MAKEINFO = @MAKEINFO@ |
| 41 | MAKEINFO_OPTS = --force --enable-encoding -I $(srcdir) |
| 42 | |
| 43 | TEXI2DVI = texi2dvi |
| 44 | TEXI2PDF = texi2pdf |
| 45 | DVIPS = dvips |
| 46 | |
| 47 | |
| 48 | ENVADD = TEXINPUTS="$(srcdir):$(texinfodir):$(TEXINPUTS)" \ |
| 49 | MAKEINFO="$(MAKEINFO) $(MAKEINFO_OPTS)" |
| 50 | |
| 51 | |
| 52 | EMACS_XTRA= \ |
| 53 | ${srcdir}/emacs-xtra.texi \ |
| 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 \ |
| 61 | $(srcdir)/fortran-xtra.texi \ |
| 62 | $(srcdir)/msdog-xtra.texi |
| 63 | |
| 64 | EMACSSOURCES= \ |
| 65 | ${srcdir}/emacs.texi \ |
| 66 | ${srcdir}/emacsver.texi \ |
| 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 | |
| 112 | ## This seems pointless. The info/ directory exists in both the |
| 113 | ## repository and the release tarfiles. We do not use any |
| 114 | ## equivalent of mkdir -p/install-sh -d, so this is not a general |
| 115 | ## solution anyway. The second test -d is for parallel builds. |
| 116 | mkinfodir = @test -d ${infodir} || mkdir ${infodir} || test -d ${infodir} |
| 117 | |
| 118 | .PHONY: info dvi html pdf ps |
| 119 | |
| 120 | info: $(infodir)/emacs |
| 121 | dvi: emacs.dvi |
| 122 | html: emacs.html |
| 123 | pdf: emacs.pdf |
| 124 | ps: emacs.ps |
| 125 | |
| 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. |
| 128 | # In a distribution of Emacs, the Info files should be up to date. |
| 129 | |
| 130 | $(infodir)/emacs: ${EMACSSOURCES} |
| 131 | $(mkinfodir) |
| 132 | $(MAKEINFO) $(MAKEINFO_OPTS) -o $@ $< |
| 133 | |
| 134 | emacs.dvi: ${EMACSSOURCES} |
| 135 | $(ENVADD) $(TEXI2DVI) $< |
| 136 | |
| 137 | emacs.ps: emacs.dvi |
| 138 | $(DVIPS) -o $@ $< |
| 139 | |
| 140 | emacs.pdf: ${EMACSSOURCES} |
| 141 | $(ENVADD) $(TEXI2PDF) $< |
| 142 | |
| 143 | emacs.html: ${EMACSSOURCES} |
| 144 | $(MAKEINFO) $(MAKEINFO_OPTS) --html -o $@ $< |
| 145 | |
| 146 | emacs-xtra.dvi: $(EMACS_XTRA) |
| 147 | $(ENVADD) $(TEXI2DVI) $< |
| 148 | |
| 149 | emacs-xtra.ps: emacs-xtra.dvi |
| 150 | $(DVIPS) -o $@ $< |
| 151 | |
| 152 | emacs-xtra.pdf: $(EMACS_XTRA) |
| 153 | $(ENVADD) $(TEXI2PDF) $< |
| 154 | |
| 155 | .PHONY: mostlyclean clean distclean maintainer-clean infoclean |
| 156 | |
| 157 | ## Temp files. |
| 158 | mostlyclean: |
| 159 | rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \ |
| 160 | *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs |
| 161 | |
| 162 | ## Products not in the release tarfiles. |
| 163 | clean: mostlyclean |
| 164 | rm -f emacs.dvi emacs-xtra.dvi emacs.pdf emacs-xtra.pdf \ |
| 165 | emacs.ps emacs-xtra.ps |
| 166 | rm -rf emacs.html/ |
| 167 | rm -f emacs-manual-${version}.tar* |
| 168 | |
| 169 | distclean: clean |
| 170 | |
| 171 | ## In the standalone tarfile, the clean rule runs this. |
| 172 | infoclean: |
| 173 | -cd $(infodir) && rm -f emacs emacs-[1-9] emacs-[1-9][0-9] |
| 174 | |
| 175 | maintainer-clean: distclean infoclean |
| 176 | |
| 177 | .PHONY: dist |
| 178 | |
| 179 | ## Make a standalone tarfile of the Emacs manual sources. |
| 180 | ## The [c] is a dumb way to prevent configure expanding it. |
| 181 | dist: |
| 182 | rm -rf emacs-manual-${version} |
| 183 | mkdir emacs-manual-${version} |
| 184 | cp ${srcdir}/*.texi ${texinfodir}/texinfo.tex \ |
| 185 | ${srcdir}/ChangeLog* emacs-manual-${version}/ |
| 186 | sed -e 's/@sr[c]dir@/./' -e 's/^\(texinfodir *=\).*/\1 ./' \ |
| 187 | -e 's/^\(infodir *=\).*/\1 ./' -e 's/^\(clean:.*\)/\1 infoclean/' \ |
| 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} |
| 192 | |
| 193 | ### Makefile ends here |