changeset 110781:664402ada542

Misc cleanup for doc/*/Makefiles. * doc/misc/Makefile.in (SHELL): Set it. (info): Move the mkdir dependency to the individual info files. (mostlyclean): Tidy up. (clean): Only delete the specific dvi and pdf files. (maintainer-clean): Be more restrictive in what we delete. * doc/lispref/Makefile.in: Rearrange to more closely resemble doc/emacs/Makefile. (INSTALL_INFO): Remove unused variable. (mostlyclean, infoclean, dist): New rules. (clean): Delete dvi and pdf files. (maintainer-clean): Remove elisp.oaux, use infoclean. * doc/lispintro/Makefile.in (SHELL): Use /bin/sh, like every other Makefile.in. (INFO_SOURCES, INFO_TARGETS, DVI_TARGETS): Remove variables. ($(infodir), html, pdf, infoclean, dist): New rules. (${infodir}/eintr): Ensure $infodir exists. Use $@. (emacs-lisp-intro.dvi, emacs-lisp-intro.pdf, emacs-lisp-intro.html): Use $^. (.PHONY): Declare clean rules. (mostlyclean): Delete more temp files. (clean): Delete specific dvi, pdf and html files. (maintainer-clean): Use infoclean. (.NOEXPORT): Remove, unused by any other Makefile.in. * doc/emacs/Makefile.in (EMACS_XTRA): Add the main source file. (emacs-xtra.dvi, emacs-xtra.pdf): Remove explicit emacs-xtra.texi. (mostlyclean): No core files, reorder other files. (clean): Delete specific dvi and pdf files. (infoclean, dist): New rules. (maintainer-clean): Use infoclean.
author Glenn Morris <rgm@gnu.org>
date Tue, 05 Oct 2010 19:26:38 -0700
parents 1d132c3c1987
children a133fd492185
files doc/emacs/ChangeLog doc/emacs/Makefile.in doc/lispintro/ChangeLog doc/lispintro/Makefile.in doc/lispref/ChangeLog doc/lispref/Makefile.in doc/misc/ChangeLog doc/misc/Makefile.in
diffstat 8 files changed, 194 insertions(+), 102 deletions(-) [+]
line wrap: on
line diff
--- a/doc/emacs/ChangeLog	Wed Oct 06 01:38:26 2010 +0000
+++ b/doc/emacs/ChangeLog	Tue Oct 05 19:26:38 2010 -0700
@@ -1,3 +1,12 @@
+2010-10-06  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (EMACS_XTRA): Add the main source file.
+	(emacs-xtra.dvi, emacs-xtra.pdf): Remove explicit emacs-xtra.texi.
+	(mostlyclean): No core files, reorder other files.
+	(clean): Delete specific dvi and pdf files.
+	(infoclean, dist): New rules.
+	(maintainer-clean): Use infoclean.
+
 2010-10-04  Glenn Morris  <rgm@gnu.org>
 
 	* Makefile.in (SHELL): Set it.
--- a/doc/emacs/Makefile.in	Wed Oct 06 01:38:26 2010 +0000
+++ b/doc/emacs/Makefile.in	Tue Oct 05 19:26:38 2010 -0700
@@ -21,9 +21,8 @@
 
 SHELL = /bin/sh
 
-# Where to find the source code.  $(srcdir) will be the man
-# subdirectory of the source tree.  This is
-# set by the configure script's `--srcdir' option.
+# Where to find the source code.  $(srcdir) will be the doc/emacs subdirectory
+# of the source tree.  This is set by configure's `--srcdir' option.
 srcdir=@srcdir@
 
 # Tell make where to find source files; this is needed for the makefiles.
@@ -50,7 +49,8 @@
 ENVADD = TEXINPUTS="$(srcdir):$(texinfodir):$(TEXINPUTS)" MAKEINFO="$(MAKEINFO) -I$(srcdir)"
 
 
-EMACS_XTRA=\
+EMACS_XTRA= \
+	${srcdir}/emacs-xtra.texi \
 	$(srcdir)/arevert-xtra.texi \
 	$(srcdir)/cal-xtra.texi \
 	$(srcdir)/dired-xtra.texi \
@@ -132,26 +132,44 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/emacs.texi
 
 
-emacs-xtra.dvi: emacs-xtra.texi $(EMACS_XTRA)
+emacs-xtra.dvi: $(EMACS_XTRA)
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi
 
-emacs-xtra.pdf: emacs-xtra.texi $(EMACS_XTRA)
+emacs-xtra.pdf: $(EMACS_XTRA)
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/emacs-xtra.texi
 
-.PHONY: mostlyclean clean distclean maintainer-clean
+.PHONY: mostlyclean clean distclean maintainer-clean infoclean
 
+## Temp files.
 mostlyclean:
-	rm -f *.log *.cp *.fn *.ky *.op *.ops *.pg *.vr core *.tp *.core
-	rm -f *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc
+	rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \
+	  *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs
 
+## Products not in the release tarfiles.
 clean: mostlyclean
-	rm -f *.dvi
+	rm -f emacs.dvi emacs-xtra.dvi emacs.pdf emacs-xtra.pdf
 
 distclean: clean
-#	rm -f Makefile
 
-maintainer-clean: distclean
-	rm -f emacs.dvi emacs.pdf
+## In the standalone tarfile, the clean rule runs this.
+infoclean:
 	-cd $(infodir) && rm -f emacs emacs-[1-9] emacs-[1-9][0-9]
 
+maintainer-clean: distclean infoclean
+
+## Make a standalone tarfile of the Emacs manual sources.
+## The [c] is a dumb way to prevent configure expanding it.
+## The emacs: rule becomes circular when we change infodir to ".".
+dist:
+	rm -rf emacs
+	mkdir emacs
+	cp ${srcdir}/*.texi ${texinfodir}/texinfo.tex \
+	  ${srcdir}/ChangeLog* emacs/
+	sed -e 's/@sr[c]dir@/./' -e 's/\(texinfodir *=\).*/\1 ./' \
+	  -e 's/\(infodir *=\).*/\1 ./' -e '/^emacs *:/d' \
+	  -e 's/^\(clean:.*\)/\1 infoclean/' \
+	  ${srcdir}/Makefile.in > emacs/Makefile
+	tar -cf emacs-texi.tar emacs
+	rm -rf emacs
+
 ### Makefile ends here
--- a/doc/lispintro/ChangeLog	Wed Oct 06 01:38:26 2010 +0000
+++ b/doc/lispintro/ChangeLog	Tue Oct 05 19:26:38 2010 -0700
@@ -1,3 +1,17 @@
+2010-10-06  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (SHELL): Use /bin/sh, like every other Makefile.in.
+	(INFO_SOURCES, INFO_TARGETS, DVI_TARGETS): Remove variables.
+	($(infodir), html, pdf, infoclean, dist): New rules.
+	(${infodir}/eintr): Ensure $infodir exists.  Use $@.
+	(emacs-lisp-intro.dvi, emacs-lisp-intro.pdf, emacs-lisp-intro.html):
+	Use $^.
+	(.PHONY): Declare clean rules.
+	(mostlyclean): Delete more temp files.
+	(clean): Delete specific dvi, pdf and html files.
+	(maintainer-clean): Use infoclean.
+	(.NOEXPORT): Remove, unused by any other Makefile.in.
+
 2010-09-21  Glenn Morris  <rgm@gnu.org>
 
 	* cons-1.eps, cons-2.eps, cons-2a.eps, cons-3.eps, cons-4.eps:
--- a/doc/lispintro/Makefile.in	Wed Oct 06 01:38:26 2010 +0000
+++ b/doc/lispintro/Makefile.in	Tue Oct 05 19:26:38 2010 -0700
@@ -1,7 +1,8 @@
 #### Makefile for the Emacs Lisp Introduction manual
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003,
-#   2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#   2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -18,8 +19,7 @@
 # You should have received a copy of the GNU General Public License
 # along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
-
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 VPATH = @srcdir@
@@ -28,12 +28,6 @@
 # Directory with the (customized) texinfo.tex file.
 texinfodir = $(srcdir)/../misc
 
-INFO_SOURCES = ${srcdir}/emacs-lisp-intro.texi
-# The file name eintr must fit within 5 characters, to allow for
-# -NN extensions to fit into DOS 8+3 limits without clashing
-INFO_TARGETS = ${infodir}/eintr
-DVI_TARGETS = emacs-lisp-intro.dvi
-
 MAKEINFO = makeinfo
 TEXI2DVI = texi2dvi
 TEXI2PDF = texi2pdf
@@ -41,37 +35,59 @@
 
 .SUFFIXES: .dvi .ps .texi
 
-info: $(INFO_TARGETS)
+info: ${infodir}/eintr
 
-dvi: $(DVI_TARGETS)
+$(infodir):
+	mkdir $@
 
-${infodir}/eintr: ${INFO_SOURCES}
-	cd $(srcdir); $(MAKEINFO) emacs-lisp-intro.texi -o $(infodir)/eintr
+dvi: emacs-lisp-intro.dvi
+html: emacs-lisp-intro.html
+pdf: emacs-lisp-intro.pdf
 
-emacs-lisp-intro.dvi: ${INFO_SOURCES}
-	$(TEXI2DVI) -I $(srcdir) -I $(texinfodir) $(srcdir)/emacs-lisp-intro.texi
+# The file name eintr must fit within 5 characters, to allow for
+# -NN extensions to fit into DOS 8+3 limits without clashing.
+${infodir}/eintr: $(infodir) ${srcdir}/emacs-lisp-intro.texi
+	cd $(srcdir); $(MAKEINFO) emacs-lisp-intro.texi -o $@
 
-emacs-lisp-intro.pdf: ${INFO_SOURCES}
-	$(TEXI2PDF) -I $(srcdir) -I $(texinfodir) $(srcdir)/emacs-lisp-intro.texi
+emacs-lisp-intro.dvi: ${srcdir}/emacs-lisp-intro.texi
+	$(TEXI2DVI) -I $(srcdir) -I $(texinfodir) $^
 
-emacs-lisp-intro.html: $(INFO_SOURCES)
-	$(MAKEINFO) --html -o $@ $(srcdir)/emacs-lisp-intro.texi
+emacs-lisp-intro.pdf: ${srcdir}/emacs-lisp-intro.texi
+	$(TEXI2PDF) -I $(srcdir) -I $(texinfodir) $^
+
+emacs-lisp-intro.html: ${srcdir}/emacs-lisp-intro.texi
+	$(MAKEINFO) --html -o $@ $^
 
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
+.PHONY: mostlyclean clean distclean maintainer-clean infoclean
+
 mostlyclean:
-	rm -f  *.log *.cp *.fn *.ky *.pg *.vr *.tp
+	rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \
+	  *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs
 
 clean: mostlyclean
-	rm -f *.dvi
+	rm -f emacs-lisp-intro.dvi emacs-lisp-intro.pdf
+	rm -rf emacs-lisp-intro.html/
 
 distclean: clean
 
-maintainer-clean: distclean
-	rm -f *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc
-	cd $(infodir); rm -f eintr eintr-[1-9]
+infoclean:
+	-cd $(infodir) && rm -f eintr eintr-[1-9]
+
+maintainer-clean: distclean infoclean
 
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
+dist:
+	rm -rf lispintro
+	mkdir lispintro
+	cp ${srcdir}/*.texi ${srcdir}/*.eps ${srcdir}/*.pdf \
+	  ${texinfodir}/texinfo.tex \
+	  ${srcdir}/ChangeLog* ${srcdir}/README lispintro/
+	sed -e 's/@sr[c]dir@/./' -e 's/\(texinfodir *=\).*/\1 ./' \
+	  -e 's/\(infodir *=\).*/\1 ./' -e 's/^\(clean:.*\)/\1 infoclean/' \
+	  ${srcdir}/Makefile.in > lispintro/Makefile
+	tar -cf emacs-lisp-intro-texi.tar lispintro
+	rm -rf lispintro
+
+### Makefile ends here
--- a/doc/lispref/ChangeLog	Wed Oct 06 01:38:26 2010 +0000
+++ b/doc/lispref/ChangeLog	Tue Oct 05 19:26:38 2010 -0700
@@ -1,3 +1,11 @@
+2010-10-06  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in: Rearrange to more closely resemble doc/emacs/Makefile.
+	(INSTALL_INFO): Remove unused variable.
+	(mostlyclean, infoclean, dist): New rules.
+	(clean): Delete dvi and pdf files.
+	(maintainer-clean): Remove elisp.oaux, use infoclean.
+
 2010-10-04  Glenn Morris  <rgm@gnu.org>
 
 	* Makefile.in (dvi, pdf, $(infodir)): New targets.
--- a/doc/lispref/Makefile.in	Wed Oct 06 01:38:26 2010 +0000
+++ b/doc/lispref/Makefile.in	Tue Oct 05 19:26:38 2010 -0700
@@ -19,6 +19,7 @@
 # You should have received a copy of the GNU General Public License
 # along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
+SHELL = /bin/sh
 
 # Standard configure variables.
 srcdir = @srcdir@
@@ -30,11 +31,9 @@
 # Directory with the (customized) texinfo.tex file.
 texinfodir = $(srcdir)/../misc
 
+MAKEINFO = makeinfo --force
 TEXI2DVI = texi2dvi
 TEXI2PDF = texi2pdf
-SHELL = /bin/sh
-INSTALL_INFO = install-info
-MAKEINFO = makeinfo --force
 
 # List of all the texinfo files in the manual:
 
@@ -109,16 +108,34 @@
 elisp.pdf: $(srcs)
 	$(TEXI2PDF) -I $(srcdir) -I $(texinfodir) $(srcdir)/elisp.texi
 
-.PHONY: clean distclean maintainer-clean
+.PHONY: mostlyclean clean distclean maintainer-clean infoclean
 
-clean:
-	rm -f *.toc *.aux *.log *.cp *.cps *.fn *.fns *.tp *.tps \
-              *.vr *.vrs *.pg *.pgs *.ky *.kys elisp[12]*
+## [12] stuff is from two-volume.make.
+mostlyclean:
+	rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \
+	  *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs
+	rm -f elisp[12]*
+
+clean: mostlyclean
+	rm -f elisp.dvi elisp.pdf vol[12].pdf
 
 distclean: clean
 
-maintainer-clean: clean
-	rm -f elisp.dvi elisp.pdf elisp.oaux
+infoclean:
 	-cd $(infodir) && rm -f elisp elisp-[1-9] elisp-[1-9][0-9]
 
+maintainer-clean: distclean infoclean
+
+## Note this excludes the two-volume stuff.
+dist:
+	rm -rf lispref
+	mkdir lispref
+	cp ${srcdir}/*.texi ${texinfodir}/texinfo.tex \
+	  ${srcdir}/ChangeLog* ${srcdir}/README lispref/
+	sed -e 's/@sr[c]dir@/./' -e 's/\(texinfodir *=\).*/\1 ./' \
+	  -e 's/\(infodir *=\).*/\1 ./' -e 's/^\(clean:.*\)/\1 infoclean/' \
+	  ${srcdir}/Makefile.in > lispref/Makefile
+	tar -cf elisp-texi.tar lispref
+	rm -rf lispref
+
 ### Makefile ends here
--- a/doc/misc/ChangeLog	Wed Oct 06 01:38:26 2010 +0000
+++ b/doc/misc/ChangeLog	Tue Oct 05 19:26:38 2010 -0700
@@ -1,3 +1,11 @@
+2010-10-06  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (SHELL): Set it.
+	(info): Move the mkdir dependency to the individual info files.
+	(mostlyclean): Tidy up.
+	(clean): Only delete the specific dvi and pdf files.
+	(maintainer-clean): Be more restrictive in what we delete.
+
 2010-10-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* gnus.texi (Misc Article): Document gnus-widen-article-window.
--- a/doc/misc/Makefile.in	Wed Oct 06 01:38:26 2010 +0000
+++ b/doc/misc/Makefile.in	Tue Oct 05 19:26:38 2010 -0700
@@ -19,6 +19,7 @@
 # You should have received a copy of the GNU General Public License
 # along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
+SHELL = /bin/sh
 
 # Where to find the source code.  $(srcdir) will be the man-aux
 # subdirectory of the source tree.  This is
@@ -198,7 +199,7 @@
 ENVADD = TEXINPUTS="$(srcdir):$(TEXINPUTS)" MAKEINFO="$(MAKEINFO) -I$(srcdir)"
 
 
-info: $(infodir) $(INFO_TARGETS)
+info: $(INFO_TARGETS)
 
 $(infodir):
 	mkdir $@
@@ -214,7 +215,7 @@
 
 ## "short" target names for convenience, to just rebuild one manual.
 ada-mode : $(infodir)/ada-mode
-$(infodir)/ada-mode: ada-mode.texi
+$(infodir)/ada-mode: ada-mode.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) ada-mode.texi
 ada-mode.dvi: ada-mode.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/ada-mode.texi
@@ -222,7 +223,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/ada-mode.texi
 
 auth : $(infodir)/auth
-$(infodir)/auth: auth.texi
+$(infodir)/auth: auth.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) auth.texi
 auth.dvi: auth.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/auth.texi
@@ -230,7 +231,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/auth.texi
 
 autotype : $(infodir)/autotype
-$(infodir)/autotype: autotype.texi
+$(infodir)/autotype: autotype.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) autotype.texi
 autotype.dvi: autotype.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/autotype.texi
@@ -238,7 +239,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/autotype.texi
 
 calc : $(infodir)/calc
-$(infodir)/calc: calc.texi
+$(infodir)/calc: calc.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) calc.texi
 calc.dvi: calc.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/calc.texi
@@ -246,7 +247,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/calc.texi
 
 ccmode : $(infodir)/ccmode
-$(infodir)/ccmode: cc-mode.texi
+$(infodir)/ccmode: cc-mode.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) cc-mode.texi
 cc-mode.dvi: cc-mode.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/cc-mode.texi
@@ -254,7 +255,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/cc-mode.texi
 
 cl : $(infodir)/cl
-$(infodir)/cl: cl.texi
+$(infodir)/cl: cl.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) cl.texi
 cl.dvi: cl.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/cl.texi
@@ -262,7 +263,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/cl.texi
 
 dbus : $(infodir)/dbus
-$(infodir)/dbus: dbus.texi
+$(infodir)/dbus: dbus.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) dbus.texi
 dbus.dvi: dbus.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/dbus.texi
@@ -270,7 +271,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/dbus.texi
 
 dired-x : $(infodir)/dired-x
-$(infodir)/dired-x: dired-x.texi
+$(infodir)/dired-x: dired-x.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) dired-x.texi
 dired-x.dvi: dired-x.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/dired-x.texi
@@ -278,7 +279,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/dired-x.texi
 
 ebrowse : $(infodir)/ebrowse
-$(infodir)/ebrowse: ebrowse.texi
+$(infodir)/ebrowse: ebrowse.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) ebrowse.texi
 ebrowse.dvi: ebrowse.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/ebrowse.texi
@@ -286,7 +287,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/ebrowse.texi
 
 ede : $(infodir)/ede
-$(infodir)/ede: ede.texi
+$(infodir)/ede: ede.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) ede.texi
 ede.dvi: ede.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/ede.texi
@@ -294,7 +295,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/ede.texi
 
 ediff : $(infodir)/ediff
-$(infodir)/ediff: ediff.texi
+$(infodir)/ediff: ediff.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) ediff.texi
 ediff.dvi: ediff.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi
@@ -302,7 +303,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/ediff.texi
 
 edt : $(infodir)/edt
-$(infodir)/edt: edt.texi
+$(infodir)/edt: edt.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) edt.texi
 edt.dvi: edt.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/edt.texi
@@ -310,7 +311,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/edt.texi
 
 eieio : $(infodir)/eieio
-$(infodir)/eieio: eieio.texi
+$(infodir)/eieio: eieio.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) eieio.texi
 eieio.dvi: eieio.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/eieio.texi
@@ -318,7 +319,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/eieio.texi
 
 emacs-mime : $(infodir)/emacs-mime
-$(infodir)/emacs-mime: emacs-mime.texi
+$(infodir)/emacs-mime: emacs-mime.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) --enable-encoding emacs-mime.texi
 emacs-mime.dvi: emacs-mime.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-mime.texi
@@ -326,7 +327,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/emacs-mime.texi
 
 epa : $(infodir)/epa
-$(infodir)/epa: epa.texi
+$(infodir)/epa: epa.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) epa.texi
 epa.dvi: epa.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/epa.texi
@@ -334,7 +335,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/epa.texi
 
 erc : $(infodir)/erc
-$(infodir)/erc: erc.texi
+$(infodir)/erc: erc.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) erc.texi
 erc.dvi: erc.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/erc.texi
@@ -342,7 +343,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/erc.texi
 
 eshell : $(infodir)/eshell
-$(infodir)/eshell: eshell.texi
+$(infodir)/eshell: eshell.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) eshell.texi
 eshell.dvi: eshell.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/eshell.texi
@@ -358,7 +359,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/eudc.texi
 
 efaq : $(infodir)/efaq
-$(infodir)/efaq: faq.texi
+$(infodir)/efaq: faq.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) faq.texi
 faq.dvi: faq.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/faq.texi
@@ -374,7 +375,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/flymake.texi
 
 forms : $(infodir)/forms
-$(infodir)/forms: forms.texi
+$(infodir)/forms: forms.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) forms.texi
 forms.dvi: forms.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/forms.texi
@@ -383,7 +384,7 @@
 
 # gnus/message/emacs-mime/sieve/pgg are part of Gnus:
 gnus : $(infodir)/gnus
-$(infodir)/gnus: gnus.texi gnus-faq.texi
+$(infodir)/gnus: gnus.texi gnus-faq.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) gnus.texi
 gnus.dvi: gnus.texi gnus-faq.texi
 	sed -e '/@iflatex/,/@end iflatex/d' ${srcdir}/gnus.texi > gnustmp.texi
@@ -399,7 +400,7 @@
 # This is produced with --no-split to avoid making files whose
 # names clash on DOS 8+3 filesystems
 idlwave : $(infodir)/idlwave
-$(infodir)/idlwave: idlwave.texi
+$(infodir)/idlwave: idlwave.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) --no-split idlwave.texi
 idlwave.dvi: idlwave.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/idlwave.texi
@@ -410,7 +411,7 @@
 # the @setfilename directive in info.texi, which is required for
 # the Texinfo distribution.
 ###info : $(infodir)/info   # circular!
-$(infodir)/info: info.texi
+$(infodir)/info: info.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) --no-split info.texi -o $@
 info.dvi: info.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/info.texi
@@ -418,7 +419,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/info.texi
 
 mairix-el : $(infodir)/mairix-el
-$(infodir)/mairix-el: mairix-el.texi
+$(infodir)/mairix-el: mairix-el.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) mairix-el.texi
 mairix-el.dvi: mairix-el.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/mairix-el.texi
@@ -426,7 +427,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/mairix-el.texi
 
 message : $(infodir)/message
-$(infodir)/message: message.texi
+$(infodir)/message: message.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) message.texi
 message.dvi: message.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/message.texi
@@ -434,7 +435,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/message.texi
 
 mh-e : $(infodir)/mh-e
-$(infodir)/mh-e: mh-e.texi
+$(infodir)/mh-e: mh-e.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) mh-e.texi
 mh-e.dvi: mh-e.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/mh-e.texi
@@ -442,7 +443,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/mh-e.texi
 
 newsticker : $(infodir)/newsticker
-$(infodir)/newsticker: newsticker.texi
+$(infodir)/newsticker: newsticker.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) newsticker.texi
 newsticker.dvi: newsticker.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/newsticker.texi
@@ -450,7 +451,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/newsticker.texi
 
 nxml-mode : $(infodir)/nxml-mode
-$(infodir)/nxml-mode: nxml-mode.texi
+$(infodir)/nxml-mode: nxml-mode.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) nxml-mode.texi
 nxml-mode.dvi: nxml-mode.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/nxml-mode.texi
@@ -458,7 +459,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/nxml-mode.texi
 
 org : $(infodir)/org
-$(infodir)/org: org.texi
+$(infodir)/org: org.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) org.texi
 org.dvi: org.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/org.texi
@@ -466,7 +467,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/org.texi
 
 pcl-cvs : $(infodir)/pcl-cvs
-$(infodir)/pcl-cvs: pcl-cvs.texi
+$(infodir)/pcl-cvs: pcl-cvs.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) pcl-cvs.texi
 pcl-cvs.dvi: pcl-cvs.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/pcl-cvs.texi
@@ -474,7 +475,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/pcl-cvs.texi
 
 pgg : $(infodir)/pgg
-$(infodir)/pgg: pgg.texi
+$(infodir)/pgg: pgg.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) pgg.texi
 pgg.dvi: pgg.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/pgg.texi
@@ -482,7 +483,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/pgg.texi
 
 rcirc : $(infodir)/rcirc
-$(infodir)/rcirc: rcirc.texi
+$(infodir)/rcirc: rcirc.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) rcirc.texi
 rcirc.dvi: rcirc.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/rcirc.texi
@@ -490,7 +491,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/rcirc.texi
 
 reftex : $(infodir)/reftex
-$(infodir)/reftex: reftex.texi
+$(infodir)/reftex: reftex.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) reftex.texi
 reftex.dvi: reftex.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/reftex.texi
@@ -498,7 +499,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/reftex.texi
 
 remember : $(infodir)/remember
-$(infodir)/remember: remember.texi
+$(infodir)/remember: remember.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) remember.texi
 remember.dvi: remember.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/remember.texi
@@ -506,7 +507,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/remember.texi
 
 sasl : $(infodir)/sasl
-$(infodir)/sasl: sasl.texi
+$(infodir)/sasl: sasl.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) sasl.texi
 sasl.dvi: sasl.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/sasl.texi
@@ -514,7 +515,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/sasl.texi
 
 sc : $(infodir)/sc
-$(infodir)/sc: sc.texi
+$(infodir)/sc: sc.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) sc.texi
 sc.dvi: sc.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/sc.texi
@@ -522,7 +523,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/sc.texi
 
 semantic : $(infodir)/semantic
-$(infodir)/semantic: semantic.texi sem-user.texi
+$(infodir)/semantic: semantic.texi sem-user.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) semantic.texi
 semantic.dvi: semantic.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/semantic.texi
@@ -530,7 +531,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/semantic.texi
 
 ses : $(infodir)/ses
-$(infodir)/ses: ses.texi
+$(infodir)/ses: ses.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) ses.texi
 ses.dvi: ses.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/ses.texi
@@ -538,7 +539,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/ses.texi
 
 sieve : $(infodir)/sieve
-$(infodir)/sieve: sieve.texi
+$(infodir)/sieve: sieve.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) sieve.texi
 sieve.dvi: sieve.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/sieve.texi
@@ -546,7 +547,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/sieve.texi
 
 smtpmail : $(infodir)/smtpmail
-$(infodir)/smtpmail: smtpmail.texi
+$(infodir)/smtpmail: smtpmail.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) smtpmail.texi
 smtpmail.dvi: smtpmail.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/smtpmail.texi
@@ -554,7 +555,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/smtpmail.texi
 
 speedbar : $(infodir)/speedbar
-$(infodir)/speedbar: speedbar.texi
+$(infodir)/speedbar: speedbar.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) speedbar.texi
 speedbar.dvi: speedbar.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/speedbar.texi
@@ -562,7 +563,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/speedbar.texi
 
 tramp : $(infodir)/tramp
-$(infodir)/tramp: tramp.texi trampver.texi
+$(infodir)/tramp: tramp.texi trampver.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) -D emacs tramp.texi
 tramp.dvi: tramp.texi trampver.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/tramp.texi
@@ -570,7 +571,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/tramp.texi
 
 url : $(infodir)/url
-$(infodir)/url: url.texi
+$(infodir)/url: url.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) url.texi
 url.dvi: url.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/url.texi
@@ -578,7 +579,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/url.texi
 
 vip : $(infodir)/vip
-$(infodir)/vip: vip.texi
+$(infodir)/vip: vip.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) vip.texi
 vip.dvi: vip.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/vip.texi
@@ -586,7 +587,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/vip.texi
 
 viper : $(infodir)/viper
-$(infodir)/viper: viper.texi
+$(infodir)/viper: viper.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) viper.texi
 viper.dvi: viper.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/viper.texi
@@ -594,7 +595,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/viper.texi
 
 widget : $(infodir)/widget
-$(infodir)/widget: widget.texi
+$(infodir)/widget: widget.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) widget.texi
 widget.dvi: widget.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/widget.texi
@@ -602,7 +603,7 @@
 	$(ENVADD) $(TEXI2PDF) ${srcdir}/widget.texi
 
 woman : $(infodir)/woman
-$(infodir)/woman: woman.texi
+$(infodir)/woman: woman.texi $(infodir)
 	cd $(srcdir); $(MAKEINFO) woman.texi
 woman.dvi: woman.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/woman.texi
@@ -611,18 +612,19 @@
 
 
 mostlyclean:
-	rm -f *.log *.cp *.fn *.ky *.op *.ops *.pg *.vr core *.tp \
-	*.tps *.core gnustmp.*
-	rm -f *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc
+	rm -f *.aux *.log *.cp *.cps *.fn *.fns *.ky *.kys \
+	  *.op *.ops *.pg *.pgs *.tp *.tps *.vr *.vrs
+	rm -f gnustmp.*
 
 clean: mostlyclean
-	rm -f *.dvi *.pdf
+	rm -f $(DVI_TARGETS) $(PDF_TARGETS)
 
 distclean: clean
 #	rm -f Makefile
 
 maintainer-clean: distclean
-	for file in $(INFO_TARGETS); do rm -f $${file}*; done
-
+	for file in $(INFO_TARGETS); do \
+	  rm -f $${file} $${file}-[1-9] $${file}-[1-9][0-9]; \
+	done
 
 ### Makefile ends here