changeset 20342:c3c1fb44f9b5

eliminate recursive make invocations in doc directory tree * doc/module.mk: New file created from doc/Makefile.am, doc/doxyhtml/Makefile.am, doc/liboctave/Makefile, doc/interpreter/Makefile.am, and doc/refcard/Makefile. * configure.ac (AC_OUTPUT): Don't generate doc/Makefile, doc/doxyhtml/Makefile, or doc/interpreter/Makefile. * Makefile.am (.NOTPARALLEL, AUTHORS, BUGS, INSTALL.OCTAVE): Delete targets. * config-images.sh, find-docstring-files.sh, geometryimages.m, graphics_properties.mk, images.awk, interpimages.m, plotimages.m, sparseimages.m, splineimages.m: Adapt to Makefile changes. * octave.texi, liboctave.texi: Use unique version file names. * etc/module.mk: Ensure icons build directory is created. (etc/icons/octave-logo.ico): Fix file name. * examples/module.mk (examples_code_SRC): New variable. * doc/Makefile.am, doc/doxyhtml/Makefile.am, doc/liboctave/Makefile.am, doc/interpreter/Makefile.am, doc/refcard/Makefile: Delete.
author John W. Eaton <jwe@octave.org>
date Fri, 03 Jul 2015 19:33:19 -0400
parents 47d704435aa4
children bacaec9b5535
files Makefile.am configure.ac doc/Makefile.am doc/doxyhtml/Makefile.am doc/interpreter/Makefile.am doc/interpreter/config-images.sh doc/interpreter/find-docstring-files.sh doc/interpreter/geometryimages.m doc/interpreter/graphics_properties.mk doc/interpreter/images.awk doc/interpreter/interpimages.m doc/interpreter/octave.texi doc/interpreter/plotimages.m doc/interpreter/sparseimages.m doc/interpreter/splineimages.m doc/liboctave/Makefile.am doc/liboctave/liboctave.texi doc/module.mk doc/refcard/Makefile.am etc/module.mk examples/module.mk
diffstat 21 files changed, 674 insertions(+), 704 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Fri Jul 03 07:51:51 2015 -0400
+++ b/Makefile.am	Fri Jul 03 19:33:19 2015 -0400
@@ -20,24 +20,21 @@
 
 include build-aux/common.mk
 
-## Avoid making multiple subdirs in parallel which can lead
-## to a confusing error message stream
-.NOTPARALLEL:
-
 octdata_DATA =
 octetc_DATA =
 
 ACLOCAL_AMFLAGS = -I m4
 
-BUILT_DISTFILES = AUTHORS BUGS ChangeLog INSTALL.OCTAVE
+BUILT_DISTFILES = \
+  AUTHORS \
+  BUGS \
+  ChangeLog \
+  INSTALL.OCTAVE
 
 EXTRA_DIST = \
-  AUTHORS \
-  BUGS \
   COPYING \
   ChangeLog \
   INSTALL \
-  INSTALL.OCTAVE \
   NEWS \
   README \
   CITATION \
@@ -48,31 +45,43 @@
   build-aux/stl_algo.h-fixed \
   run-octave.in
 
+DIRSTAMP_FILES =
+
+octave_dirstamp = $(am__leading_dot)octave-dirstamp
+
+$(DIRSTAMP_FILES):
+	$(AM_V_GEN)$(MKDIR_P) $(@D) && \
+	: > $@
+
 CLEANFILES =
 DISTCLEANFILES =
 MAINTAINERCLEANFILES =
+info_TEXINFOS =
+BUILT_SOURCES =
 
+IMAGES_SRC =
+IMAGES_EPS =
+IMAGES_PDF =
+IMAGES_PNG =
+IMAGES_TXT =
+
+include doc/module.mk
+include doc/interpreter/images.mk
 include etc/module.mk
 include examples/module.mk
 include m4/module.mk
 
-# Subdirectories in which to run `make all'.  Including "." before
-# @DOCDIR@ is an attempt to force all preceding directories in the list
-# to be processed before the current directory so that the
-# scripts/DOCSTRINGS libinterp/DOCSTRINGS files are built before
-# attempting to build AUTHORS and BUGS.  Including "." again at the end
-# of the list ensures that we display the "Octave sucessfully built..."
-# message at the very end of the output from Make.  Another fix for
-# these problems would be to continue eliminating the recursive make
-# invocations so that we have better control over the dependencies and
-# the order that things are built.
+# Subdirectories in which to run make recursively.  Other
+# directories are handled directly from this Makefile (see also the
+# included makefile fragments).
+
 SUBDIRS = libgnu liboctave libinterp
 if AMCOND_BUILD_GUI
 SUBDIRS += libgui
 endif
-SUBDIRS += src scripts . @DOCDIR@ test .
+SUBDIRS += src scripts test
 
-dist-hook: docs-dist-hook icons-dist-hook
+dist-hook: doc-interpreter-dist-hook docs-dist-hook icons-dist-hook
 
 if AMCOND_BUILD_DOCS
 docs-dist-hook:
@@ -88,7 +97,9 @@
 	@echo "Packaging distribution requires icotool and rsvg-convert." ; exit 1;
 endif
 
-BUILT_SOURCES = run-octave
+BUILT_SOURCES += \
+  run-octave \
+  $(DIRSTAMP_FILES)
 
 if AMCOND_HAVE_BROKEN_STL_ALGO_H
   BUILT_SOURCES += bits/stl_algo.h
@@ -98,17 +109,13 @@
 
 noinst_SCRIPTS = run-octave
 
-INFO_FILES = \
-  AUTHORS \
-  BUGS \
-  INSTALL.OCTAVE
-
 CLEANFILES += \
   $(BUILT_SOURCES)
 
 DISTCLEANFILES += \
   .gdbinit \
-  ChangeLog
+  ChangeLog \
+  $(DIRSTAMP_FILES)
 
 MAINTAINERCLEANFILES += \
   $(BUILT_DISTFILES)
@@ -118,7 +125,7 @@
 nodist_octinclude_HEADERS = config.h
 octinclude_HEADERS = oct-conf-post.h
 
-all-local: $(noinst_SCRIPTS) $(INFO_FILES) .gdbinit
+all-local: $(noinst_SCRIPTS) $(DIST_INFO_FILES) .gdbinit $(DOC_TARGETS)
 	@echo ""
 	@echo "Octave successfully built.  Now choose from the following:"
 	@echo ""
@@ -153,12 +160,6 @@
 .gdbinit: etc/gdbinit
 	@$(gdbinit_install_rule)
 
-if AMCOND_BUILD_DOCS
-AUTHORS BUGS INSTALL.OCTAVE:
-	$(AM_V_GEN)$(MAKE) -C doc/interpreter ../../$@
-endif
-.PHONY: AUTHORS BUGS INSTALL.OCTAVE
-
 define changelog-from-hg-log
   rm -f $@-t $@ && \
   ( cd $(srcdir); \
@@ -181,10 +182,6 @@
 octetc_DATA += config.log
 endif
 
-doxyhtml:
-	$(MAKE) -C doc/doxyhtml doxyhtml
-.PHONY: doxyhtml
-
 DIRS_TO_MAKE = \
   $(localfcnfiledir) \
   $(localapifcnfiledir) \
--- a/configure.ac	Fri Jul 03 07:51:51 2015 -0400
+++ b/configure.ac	Fri Jul 03 19:33:19 2015 -0400
@@ -256,16 +256,15 @@
 ### Disable running Make in the doc directory.
 ### This is useful, for example, when building Octave on systems without TeX.
 
-DOCDIR=doc
+ENABLE_DOCS=yes
 AC_ARG_ENABLE([docs],
   [AS_HELP_STRING([--disable-docs], [don't build documentation files])],
   [if test "$enableval" = no; then
-     DOCDIR=
+     ENABLE_DOCS=no
      warn_docs="building documentation disabled; make dist will fail"
      OCTAVE_CONFIGURE_WARNING([warn_docs])
    fi],
   [])
-AC_SUBST(DOCDIR)
 
 ### If possible, use a 64-bit integer type for array dimensions and indexing.
 
@@ -2447,19 +2446,19 @@
 ### makeinfo are missing.  Skip this warning if building docs was
 ### disabled with a configure option.
 
-if test -n "$DOCDIR"; then
+if test $ENABLE_DOCS = yes; then
   if test -n "$warn_gnuplot"; then
-    DOCDIR=
+    ENABLE_DOCS = no
     warn_docs_gnuplot="building documentation disabled because gnuplot was not found; make dist will fail"
     OCTAVE_CONFIGURE_WARNING([warn_docs_gnuplot])
   fi
   if test -n "$warn_makeinfo"; then
-    DOCDIR=
+    ENABLE_DOCS = no
     warn_docs_makeinfo="building documentation disabled because makeinfo was not found; make dist will fail"
     OCTAVE_CONFIGURE_WARNING([warn_docs_makeinfo])
   fi
 fi
-AM_CONDITIONAL([AMCOND_BUILD_DOCS], [test -n "$DOCDIR"])
+AM_CONDITIONAL([AMCOND_BUILD_DOCS], [test $ENABLE_DOCS = yes])
 
 ### Maybe add -Wall, -W, and -Wshadow to compiler flags now that we're
 ### done feature testing.
@@ -2997,12 +2996,7 @@
 AC_CONFIG_FILES([
   oct-conf-post.h:oct-conf-post.in.h
   Makefile
-  doc/Makefile
-  doc/doxyhtml/Makefile
   doc/doxyhtml/Doxyfile
-  doc/interpreter/Makefile
-  doc/liboctave/Makefile
-  doc/refcard/Makefile
   libgnu/Makefile
   libgui/Makefile
   libinterp/Makefile
@@ -3134,6 +3128,7 @@
   64-bit array dims and indexing:     $USE_64_BIT_IDX_T
   OpenMP SMP multithreading:          $USE_OPENMP
   Build cross tools:                  $cross_tools
+  Build docs:                         $ENABLE_DOCS
 ])
 
 warn_msg_printed=false
--- a/doc/Makefile.am	Fri Jul 03 07:51:51 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-# Makefile for Octave's doc directory
-#
-# Copyright (C) 1993-2015 John W. Eaton
-#
-# This file is part of Octave.
-#
-# Octave is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 3 of the License, or (at
-# your option) any later version.
-#
-# Octave is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Octave; see the file COPYING.  If not, see
-# <http://www.gnu.org/licenses/>.
-
-include $(top_srcdir)/build-aux/common.mk
-
-## Avoid making multiple subdirs in parallel
-## which can lead to a confusing error message stream.
-.NOTPARALLEL:
-
-EXTRA_DIST = \
-  Makefile.am \
-  texinfo.tex \
-  texmf.cnf
-
-SUBDIRS = doxyhtml interpreter liboctave refcard
-
--- a/doc/doxyhtml/Makefile.am	Fri Jul 03 07:51:51 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-# Makefile for Octave's doc/doxyhtml directory
-#
-# Copyright (C) 1993-2015 John W. Eaton
-#
-# This file is part of Octave.
-#
-# Octave is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 3 of the License, or (at
-# your option) any later version.
-#
-# Octave is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Octave; see the file COPYING.  If not, see
-# <http://www.gnu.org/licenses/>.
-
-include $(top_srcdir)/build-aux/common.mk
-
-doxyhtml:
-	doxygen Doxyfile
-
-EXTRA_DIST = \
-  Doxyfile.in \
-  Makefile.am \
-  README
-
-maintainer-clean-local:
-	rm -rf `ls | $(GREP) -v Doxyfile | $(GREP) -v Makefile.am | $(GREP) -v Makefile.in | $(GREP) -v README`
--- a/doc/interpreter/Makefile.am	Fri Jul 03 07:51:51 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,305 +0,0 @@
-# Makefile for Octave's doc/interpreter directory
-#
-# Copyright (C) 1993-2015 John W. Eaton
-#
-# This file is part of Octave.
-#
-# Octave is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 3 of the License, or (at
-# your option) any later version.
-#
-# Octave is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Octave; see the file COPYING.  If not, see
-# <http://www.gnu.org/licenses/>.
-
-include $(top_srcdir)/build-aux/common.mk
-
-TEXINFO_TEX = ../texinfo.tex
-
-## Leading PATH_SEPARATOR required due to weak parsing by dvips (12/04/09)
-TEXINPUTS := "$(PATH_SEPARATOR)$(srcdir)$(PATH_SEPARATOR)$(TEXINPUTS)$(PATH_SEPARATOR)"
-export TEXINPUTS
-
-## Include custom texmf.cnf necessary to run @seealso macro
-TEXMFCNF := "..$(PATH_SEPARATOR)$(srcdir)/..$(PATH_SEPARATOR)$(TEXMFCNF)$(PATH_SEPARATOR)"
-export TEXMFCNF
-
-dist_man_MANS = \
-  mkoctfile.1 \
-  octave-cli.1 \
-  octave-config.1 \
-  octave.1
-
-## The following files are included in the manual via the @EXAMPLEFILE macro.
-## They are dependencies for the documentation.
-## They must not be distributed from this directory.
-EXAMPLE_FILES = \
-  $(top_srcdir)/examples/code/@FIRfilter/FIRfilter.m \
-  $(top_srcdir)/examples/code/@FIRfilter/FIRfilter_aggregation.m \
-  $(top_srcdir)/examples/code/@FIRfilter/display.m \
-  $(top_srcdir)/examples/code/@FIRfilter/subsasgn.m \
-  $(top_srcdir)/examples/code/@FIRfilter/subsref.m \
-  $(top_srcdir)/examples/code/@polynomial/display.m \
-  $(top_srcdir)/examples/code/@polynomial/double.m \
-  $(top_srcdir)/examples/code/@polynomial/end.m \
-  $(top_srcdir)/examples/code/@polynomial/get.m \
-  $(top_srcdir)/examples/code/@polynomial/mtimes.m \
-  $(top_srcdir)/examples/code/@polynomial/plot.m \
-  $(top_srcdir)/examples/code/@polynomial/polynomial.m \
-  $(top_srcdir)/examples/code/@polynomial/polynomial_superiorto.m \
-  $(top_srcdir)/examples/code/@polynomial/polyval.m \
-  $(top_srcdir)/examples/code/@polynomial/set.m \
-  $(top_srcdir)/examples/code/@polynomial/subsref.m \
-  $(top_srcdir)/examples/code/addtwomatrices.cc \
-  $(top_srcdir)/examples/code/celldemo.cc \
-  $(top_srcdir)/examples/code/embedded.cc \
-  $(top_srcdir)/examples/code/fortrandemo.cc \
-  $(top_srcdir)/examples/code/fortransub.f \
-  $(top_srcdir)/examples/code/funcdemo.cc \
-  $(top_srcdir)/examples/code/globaldemo.cc \
-  $(top_srcdir)/examples/code/helloworld.cc \
-  $(top_srcdir)/examples/code/mycell.c \
-  $(top_srcdir)/examples/code/myfeval.c \
-  $(top_srcdir)/examples/code/myfunc.c \
-  $(top_srcdir)/examples/code/myhello.c \
-  $(top_srcdir)/examples/code/mypow2.c \
-  $(top_srcdir)/examples/code/mysparse.c \
-  $(top_srcdir)/examples/code/mystring.c \
-  $(top_srcdir)/examples/code/mystruct.c \
-  $(top_srcdir)/examples/code/paramdemo.cc \
-  $(top_srcdir)/examples/code/standalone.cc \
-  $(top_srcdir)/examples/code/stringdemo.cc \
-  $(top_srcdir)/examples/code/structdemo.cc \
-  $(top_srcdir)/examples/code/unwinddemo.cc
-
-
-include images.mk
-
-$(srcdir)/images.mk: $(srcdir)/config-images.sh $(srcdir)/images.awk $(srcdir)/images
-	$(srcdir)/config-images.sh $(top_srcdir)
-
-JAVA_IMAGES = \
-  java-images/image001.png \
-  java-images/image002.png \
-  java-images/image003.png \
-  java-images/image004.png \
-  java-images/image005.png \
-  java-images/image006.png \
-  java-images/image007.png \
-  java-images/image008.png \
-  java-images/image009.png
-
-BUILT_IMAGES = \
-  $(IMAGES_EPS) \
-  $(IMAGES_PDF) \
-  $(IMAGES_PNG) \
-  $(IMAGES_TXT)
-
-IMAGES = \
-  $(BUILT_IMAGES) \
-  $(JAVA_IMAGES)
-
-## FIXME: JAVA_IMAGES will eventually need to be added to the HTML build.
-##        It will require a different Makefile rule later because
-##        JAVA_IMAGES live in a subdir rather than in the current directory.
-HTMLDIR_IMAGES = $(addprefix octave.html/, $(IMAGES_PNG))
-
-LOGOS = \
-  octave_logo.eps \
-  octave_logo.pdf
-
-MUNGED_TEXI_SRC = \
-  arith.texi \
-  audio.texi \
-  basics.texi \
-  bugs.texi \
-  container.texi \
-  contrib.texi \
-  cp-idx.texi \
-  data.texi \
-  debug.texi \
-  diffeq.texi \
-  diagperm.texi \
-  external.texi \
-  emacs.texi \
-  errors.texi \
-  eval.texi \
-  expr.texi \
-  fn-idx.texi \
-  func.texi \
-  geometry.texi \
-  gui.texi \
-  gpl.texi \
-  grammar.texi \
-  image.texi \
-  install.texi \
-  interp.texi \
-  intro.texi \
-  io.texi \
-  java.texi \
-  linalg.texi \
-  matrix.texi \
-  nonlin.texi \
-  numbers.texi \
-  obsolete.texi \
-  oop.texi \
-  op-idx.texi \
-  optim.texi \
-  package.texi \
-  plot.texi \
-  poly.texi \
-  preface.texi \
-  quad.texi \
-  set.texi \
-  signal.texi \
-  sparse.texi \
-  stats.texi \
-  stmt.texi \
-  strings.texi \
-  system.texi \
-  testfun.texi \
-  tips.texi \
-  var.texi \
-  vectorize.texi
-
-TXI_SRC = $(MUNGED_TEXI_SRC:.texi=.txi)
-
-include graphics_properties.mk
-
-BUILT_TEXINFOS = \
-  contributors.texi \
-  $(GRAPH_PROP_TEXI_SRC) \
-  $(MUNGED_TEXI_SRC)
-
-info_TEXINFOS = octave.texi
-
-octave_TEXINFOS = \
-  $(BUILT_TEXINFOS) \
-  $(EXAMPLE_FILES) \
-  $(IMAGES) \
-  $(LOGOS) \
-  $(srcdir)/images.mk
-
-all-local: dvi html pdf ps doc-cache
-
-html: $(HTMLDIR_IMAGES)
-
-$(HTMLDIR_IMAGES): $(IMAGES_PNG) | octave.html
-	cp $(@F) octave.html
-
-## The texi2dvi script (used to create both PDF and DVI output formats)
-## uses some fixed temporary file names.  In order to avoid a race condition
-## the DVI and PDF builds are forced to run serially through a Makefile rule.
-octave.pdf: octave.dvi
-
-# Prevent packaging of distribution unless all libraries
-# necessary to create documentation are present
-dist-hook:
-	@$(GREP) '#define HAVE_COLAMD 1' $(top_builddir)/config.h > /dev/null || { echo "Documentation creation requires missing COLAMD library.  Cannot package distribution!" ; exit 1; }
-	@$(GREP) '#define HAVE_CHOLMOD 1' $(top_builddir)/config.h > /dev/null || { echo "Documentation creation requires missing CHOLMOD library.  Cannot package distribution!" ; exit 1; }
-	@$(GREP) '#define HAVE_UMFPACK 1' $(top_builddir)/config.h > /dev/null || { echo "Documentation creation requires missing UMFPACK library.  Cannot package distribution!" ; exit 1; }
-	@$(GREP) '#define HAVE_QHULL 1' $(top_builddir)/config.h > /dev/null || { echo "Documentation creation requires missing QHULL library.  Cannot package distribution!" ; exit 1; }
-
-octetc_DATA = doc-cache macros.texi
-
-DOCSTRING_FILES = $(shell $(srcdir)/find-docstring-files.sh "$(top_srcdir)")
-
-doc-cache: $(DOCSTRING_FILES) mk_doc_cache.m
-	$(AM_V_GEN)rm -f $@-t $@ && \
-	$(top_builddir)/run-octave -f -q -H $(srcdir)/mk_doc_cache.m - $(srcdir)/macros.texi $(DOCSTRING_FILES) >$@-t && \
-	mv $@-t $@
-
-$(MUNGED_TEXI_SRC): $(DOCSTRING_FILES) $(munge_texi_SOURCES)
-
-%.texi: %.txi munge-texi.pl
-	$(AM_V_GEN)rm -f $@-t $@ && \
-	$(PERL) $(srcdir)/munge-texi.pl $(top_srcdir) $(DOCSTRING_FILES) < $< > $@-t && \
-	mv $@-t $@
-
-contributors.texi: contributors.in
-	$(AM_V_GEN)rm -f $@-t $@ && \
-	$(AWK) -f $(srcdir)/mkcontrib.awk $(srcdir)/contributors.in > $@-t && \
-	mv $@-t $@
-
-../../AUTHORS: preface.texi contributors.texi
-	$(AM_V_MAKEINFO)rm -f AUTHORS && \
-	if [ "x$(srcdir)" != "x." ] && [ -f $(srcdir)/contributors.texi ] && [ ! -f contributors.texi ]; then \
-		cp $(srcdir)/contributors.texi contributors.texi; \
-		touch -r $(srcdir)/contributors.texi contributors.texi; \
-	fi && \
-	$(MAKEINFO) -D AUTHORSONLY -I $(srcdir) \
-	  --no-validate --no-headers --no-split --output AUTHORS $< && \
-	mv AUTHORS ../../AUTHORS
-
-../../BUGS: bugs.texi
-	$(AM_V_MAKEINFO)rm -f BUGS && \
-	$(MAKEINFO) -D BUGSONLY -I $(srcdir) \
-	  --no-validate --no-headers --no-split --output BUGS $< && \
-	mv BUGS ../../BUGS
-
-../../INSTALL.OCTAVE: install.texi
-	$(AM_V_MAKEINFO)rm -f INSTALL && \
-	$(MAKEINFO) -D INSTALLONLY -I $(srcdir) \
-	  --no-validate --no-headers --no-split --output INSTALL $< && \
-	mv INSTALL ../../INSTALL.OCTAVE
-
-
-undocumented_list:
-	rm -f $@
-	-$(PERL) $(srcdir)/doccheck/mk_undocumented_list > $@
-.PHONY: undocumented_list
-
-SPELLCHECK_FILES = $(MUNGED_TEXI_SRC:.texi=.scheck)
-
-%.scheck: %.texi
-	$(srcdir)/doccheck/spellcheck $< > $@-t
-	mv $@-t $@
-	[ -s $@ ] || rm -f $@
-
-spellcheck: $(SPELLCHECK_FILES)
-	@if ls *.scheck >/dev/null 2>&1 ; then \
-		echo "Spellcheck failed"; \
-		echo "Review the following files:"; \
-		ls *.scheck ; \
-		exit 1 ; \
-	else \
-		echo "Spellcheck passed"; \
-	fi
-.PHONY: spellcheck
-
-EXTRA_DIST = \
-  config-images.sh \
-  contributors.in \
-  doc-cache \
-  find-docstring-files.sh \
-  genpropdoc.m \
-  graphics_properties.mk \
-  images \
-  images.awk \
-  images.mk \
-  macros.texi \
-  mk_doc_cache.m \
-  mkcontrib.awk \
-  munge-texi.pl \
-  octave.dvi \
-  octave.html \
-  octave.pdf \
-  octave.ps \
-  $(IMAGES) \
-  $(IMAGES_SRC) \
-  $(LOGOS) \
-  $(TXI_SRC)
-
-clean-local:
-	rm -rf t2d_cache
-
-DISTCLEANFILES = $(BUILT_TEXINFOS)
-
-MAINTAINERCLEANFILES = $(BUILT_IMAGES) doc-cache
-
--- a/doc/interpreter/config-images.sh	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/config-images.sh	Fri Jul 03 19:33:19 2015 -0400
@@ -14,6 +14,6 @@
 
 interp_dir=$top_srcdir/doc/interpreter
 
-$AWK -f $interp_dir/images.awk < $interp_dir/images > $interp_dir/images.mk-t
+$AWK -v dir=doc/interpreter -f $interp_dir/images.awk < $interp_dir/images > $interp_dir/images.mk-t
 
 $move_if_change $interp_dir/images.mk-t $interp_dir/images.mk
--- a/doc/interpreter/find-docstring-files.sh	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/find-docstring-files.sh	Fri Jul 03 19:33:19 2015 -0400
@@ -5,18 +5,23 @@
   exit 1
 fi
 
-## if there is a file in the build directory tree, assume it is
-## the file we are looking for.  Otherwise, get the one from the
-## source tree.
+## Look in the build tree then the source tree for the
+## DOCSTRINGS files.  Fail if neither exists.
 
-if [ -f "../../scripts/DOCSTRINGS" ]; then
-  echo "../../scripts/DOCSTRINGS"
+if [ -f "scripts/DOCSTRINGS" ]; then
+  echo "scripts/DOCSTRINGS"
+elif [ -f "$1/scripts/DOCSTRINGS" ]; then
+  echo "$1/scripts/DOCSTRINGS"
 else
-  echo "$1/scripts/DOCSTRINGS"
+  echo "find-docstring-files: scripts/DOCSTRINGS file is missing!" 1>&2
+  exit 1
 fi
 
-if [ -f "../../libinterp/DOCSTRINGS" ]; then
-  echo "../../libinterp/DOCSTRINGS"
+if [ -f "libinterp/DOCSTRINGS" ]; then
+  echo "libinterp/DOCSTRINGS"
+elif [ -f "$1/libinterp/DOCSTRINGS" ]; then
+  echo "$1/libinterp/DOCSTRINGS"
 else
-  echo "$1/libinterp/DOCSTRINGS"
+  echo "find-docstring-files: libinterp/DOCSTRINGS file is missing!" 1>&2
+  exit 1
 fi
--- a/doc/interpreter/geometryimages.m	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/geometryimages.m	Fri Jul 03 19:33:19 2015 -0400
@@ -16,10 +16,11 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-function geometryimages (nm, typ)
+function geometryimages (d, nm, typ)
   graphics_toolkit ("gnuplot");
   set_print_size ();
   hide_output ();
+  outfile = fullfile (d, strcat (nm, ".", typ));
   if (strcmp (typ, "png"))
     set (0, "defaulttextfontname", "*");
   endif
@@ -34,7 +35,7 @@
                            "triplot"})))
     sombreroimage (nm, typ, d_typ);
   elseif (strcmp (typ, "txt"))
-    image_as_txt (nm);
+    image_as_txt (d, nm);
   elseif (strcmp (nm, "voronoi"))
     rand ("state", 9);
     x = rand (10, 1);
@@ -51,14 +52,14 @@
     plot (xc, yc, "g-", "LineWidth", 3);
     axis([0, 1, 0, 1]);
     legend ("Delaunay Triangulation", "Voronoi Diagram");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "triplot"))
     rand ("state", 2)
     x = rand (20, 1);
     y = rand (20, 1);
     tri = delaunay (x, y);
     triplot (tri, x, y);
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "griddata"))
     rand ("state", 1);
     x = 2 * rand (1000,1) - 1;
@@ -67,14 +68,14 @@
     [xx,yy] = meshgrid (linspace (-1,1,32));
     zz = griddata (x, y, z, xx, yy);
     mesh (xx, yy, zz);
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "convhull"))
     x = -3:0.05:3;
     y = abs (sin (x));
     k = convhull (x, y);
     plot (x(k),y(k),'r-', x,y,'b+');
     axis ([-3.05, 3.05, -0.05, 1.05]);
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "delaunay"))
     rand ("state", 1);
     x = rand (1, 10);
@@ -84,7 +85,7 @@
     Y = [ y(T(:,1)); y(T(:,2)); y(T(:,3)); y(T(:,1)) ];
     axis ([0, 1, 0, 1]);
     plot (X,Y,"b", x,y,"r*");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "inpolygon"))
     randn ("state", 2);
     x = randn (100, 1);
@@ -94,7 +95,7 @@
     in = inpolygon (x, y, vx, vy);
     plot (vx, vy, x(in), y(in), "r+", x(!in), y(!in), "bo");
     axis ([-2, 2, -2, 2]);
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   else
     error ("unrecognized plot requested");
   endif
@@ -147,15 +148,15 @@
       mesh (x, y, z);
       title ("Sorry, graphics not available because octave was\\ncompiled without the QHULL library.");
     unwind_protect_cleanup
-      print ([nm "." typ], d_typ);
+      print (outfile, d_typ);
       hide_output ();
     end_unwind_protect
   endif
 endfunction
 
 ## generate something for the texinfo @image command to process
-function image_as_txt (nm)
-  fid = fopen (sprintf ("%s.txt", nm), "wt");
+function image_as_txt (d, nm)
+  fid = fopen (fullfile (d, strcat (nm, ".txt")), "wt");
   fputs (fid, "\n");
   fputs (fid, "+---------------------------------+\n");
   fputs (fid, "| Image unavailable in text mode. |\n");
--- a/doc/interpreter/graphics_properties.mk	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/graphics_properties.mk	Fri Jul 03 19:33:19 2015 -0400
@@ -1,39 +1,39 @@
 GRAPH_PROP_TEXI_SRC= \
-  plot-axesproperties.texi \
-  plot-figureproperties.texi \
-  plot-imageproperties.texi \
-  plot-lineproperties.texi \
-  plot-patchproperties.texi \
-  plot-rootproperties.texi \
-  plot-surfaceproperties.texi \
-  plot-textproperties.texi
+  interpreter/plot-axesproperties.texi \
+  interpreter/plot-figureproperties.texi \
+  interpreter/plot-imageproperties.texi \
+  interpreter/plot-lineproperties.texi \
+  interpreter/plot-patchproperties.texi \
+  interpreter/plot-rootproperties.texi \
+  interpreter/plot-surfaceproperties.texi \
+  interpreter/plot-textproperties.texi
 
 define gen-propdoc-texi
   rm -f $@-t $@ && \
-  $(top_builddir)/run-octave -f -q -H -p $(srcdir) --eval "genpropdoc ('$(1)');" > $@-t && \
+  $(top_builddir)/run-octave -f -q -H -p $(srcdir)/interpreter --eval "genpropdoc ('$(1)');" > $@-t && \
   mv $@-t $@
 endef
 
-plot-axesproperties.texi: genpropdoc.m
+interpreter/plot-axesproperties.texi: interpreter/genpropdoc.m
 	$(AM_V_GEN)$(call gen-propdoc-texi,axes)
 
-plot-figureproperties.texi: genpropdoc.m
+interpreter/plot-figureproperties.texi: interpreter/genpropdoc.m
 	$(AM_V_GEN)$(call gen-propdoc-texi,figure)
 
-plot-imageproperties.texi: genpropdoc.m
+interpreter/plot-imageproperties.texi: interpreter/genpropdoc.m
 	$(AM_V_GEN)$(call gen-propdoc-texi,image)
 
-plot-lineproperties.texi: genpropdoc.m
+interpreter/plot-lineproperties.texi: interpreter/genpropdoc.m
 	$(AM_V_GEN)$(call gen-propdoc-texi,line)
 
-plot-patchproperties.texi: genpropdoc.m
+interpreter/plot-patchproperties.texi: interpreter/genpropdoc.m
 	$(AM_V_GEN)$(call gen-propdoc-texi,patch)
 
-plot-rootproperties.texi: genpropdoc.m
+interpreter/plot-rootproperties.texi: interpreter/genpropdoc.m
 	$(AM_V_GEN)$(call gen-propdoc-texi,root)
 
-plot-surfaceproperties.texi: genpropdoc.m
+interpreter/plot-surfaceproperties.texi: interpreter/genpropdoc.m
 	$(AM_V_GEN)$(call gen-propdoc-texi,surface)
 
-plot-textproperties.texi: genpropdoc.m
+interpreter/plot-textproperties.texi: interpreter/genpropdoc.m
 	$(AM_V_GEN)$(call gen-propdoc-texi,text)
--- a/doc/interpreter/images.awk	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/images.awk	Fri Jul 03 19:33:19 2015 -0400
@@ -1,36 +1,39 @@
 BEGIN {
-  print "## DO NOT EDIT -- generated from module-files by config-module.awk";
+  print "## DO NOT EDIT -- generated from module-files by images.awk";
   print "";
+  print "if AMCOND_BUILD_DOCS";
+
+  if (dir !~ /\/$/)
+      dir = dir "/";
 
   exts[1] = "eps";
   exts[2] = "pdf";
   exts[3] = "png";
   exts[4] = "txt";
-  printf ("IMAGES_SRC =\n");
-  for (i = 1; i <= 4; i++) {
-    printf ("IMAGES_%s =\n", toupper (exts[i]));
-  }
 } {
   script = $1;
   basename = script;
   sub (/\.m$/, "", basename);
   ubasename = toupper (basename);
-  printf ("IMAGES_SRC += %s\n", script);
+  printf ("IMAGES_SRC += %s%s\n", dir, script);
   for (i = 1; i <= 4; i++) {
     ext = exts[i];
     uext = toupper (ext);
 
     printf ("%s_%s =", ubasename, uext);
     for (j = 2; j <= NF; j++)
-      printf (" %s.%s", $j, ext);
+      printf (" %s%s.%s", dir, $j, ext);
     printf ("\n");
 
     printf ("IMAGES_%s += $(%s_%s)\n", uext, ubasename, uext);
 
     for (j = 2; j <= NF; j++) {
-      printf ("%s.%s: %s\n", $j, ext, script);
-      printf ("\t$(AM_V_GEN)$(top_builddir)/run-octave -f -q -H -p $(srcdir) --eval \"%s ('%s', '%s');\"\n",
-              basename, $j, ext);
+      printf ("%s%s.%s: %s%s\n", dir, $j, ext, dir, script);
+      printf ("\t$(AM_V_GEN)$(abs_top_builddir)/run-octave -f -q -H -p $(srcdir)/%s --eval \"%s ('%s', '%s', '%s');\"\n",
+              dir, basename, dir, $j, ext);
     }
   }
 }
+END {
+  print "endif";
+}
--- a/doc/interpreter/interpimages.m	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/interpimages.m	Fri Jul 03 19:33:19 2015 -0400
@@ -16,10 +16,11 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-function interpimages (nm, typ)
+function interpimages (d, nm, typ)
   graphics_toolkit ("gnuplot");
   set_print_size ();
   hide_output ();
+  outfile = fullfile (d, strcat (nm, ".", typ));
   if (strcmp (typ, "png"))
     set (0, "defaulttextfontname", "*");
   endif
@@ -30,7 +31,7 @@
   endif
 
   if (strcmp (typ, "txt"))
-    image_as_txt (nm);
+    image_as_txt (d, nm);
   elseif (strcmp (nm, "interpft"))
     t = 0 : 0.3 : pi; dt = t(2)-t(1);
     n = length (t); k = 100;
@@ -40,7 +41,7 @@
     plot (ti, yp, "g", ti, interp1 (t, y, ti, "spline"), "b", ...
           ti, interpft (y, k), "c", t, y, "r+");
     legend ("sin(4t+0.3)cos(3t-0.1)", "spline", "interpft", "data");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "interpn"))
     x = y = z = -1:1;
     f = @(x,y,z) x.^2 - y - z.^2;
@@ -50,7 +51,7 @@
     [xxi, yyi, zzi] = ndgrid (xi, yi, zi);
     vi = interpn (x, y, z, v, xxi, yyi, zzi, "spline");
     mesh (zi, yi, squeeze (vi(1,:,:)));
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "interpderiv1"))
     t = -2:2;
     dt = 1;
@@ -61,7 +62,7 @@
     yp = interp1 (t,y,ti,"pchip");
     plot (ti, ys,"r-", ti, yp,"g-");
     legend ("spline","pchip", 4);
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "interpderiv2"))
     t = -2:2;
     dt = 1;
@@ -72,7 +73,7 @@
     ddyp = diff (diff (interp1 (t,y,ti,"pchip"))./dti)./dti;
     plot (ti(2:end-1),ddys,"r*", ti(2:end-1),ddyp,"g+");
     legend ("spline", "pchip");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   endif
   hide_output ();
 endfunction
@@ -95,8 +96,8 @@
 endfunction
 
 ## generate something for the texinfo @image command to process
-function image_as_txt(nm)
-  fid = fopen (sprintf ("%s.txt", nm), "wt");
+function image_as_txt(d, nm)
+  fid = fopen (fullfile (d, strcat (nm, ".txt")), "wt");
   fputs (fid, "\n");
   fputs (fid, "+---------------------------------+\n");
   fputs (fid, "| Image unavailable in text mode. |\n");
--- a/doc/interpreter/octave.texi	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/octave.texi	Fri Jul 03 19:33:19 2015 -0400
@@ -57,7 +57,7 @@
 @c The version.texi file doesn't include a chapter, so it must not be
 @c included if you want to run the Emacs function
 @c texinfo-multiple-files-update.
-@include version.texi
+@include version-octave.texi
 
 @settitle GNU Octave
 
--- a/doc/interpreter/plotimages.m	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/plotimages.m	Fri Jul 03 19:33:19 2015 -0400
@@ -16,10 +16,11 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-function plotimages (nm, typ)
+function plotimages (d, nm, typ)
   graphics_toolkit ("gnuplot");
   set_print_size ();
   hide_output ();
+  outfile = fullfile (d, strcat (nm, ".", typ));
   if (strcmp (typ, "png"))
     set (0, "defaulttextfontname", "*");
   endif
@@ -30,21 +31,21 @@
   endif
 
   if (strcmp(typ , "txt"))
-    image_as_txt(nm);
+    image_as_txt(d, nm);
   elseif (strcmp (nm, "plot"))
     x = -10:0.1:10;
     plot (x, sin (x));
     xlabel ("x");
     ylabel ("sin (x)");
     title ("Simple 2-D Plot");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "hist"))
     randn ("state", 1);
     hist (randn (10000, 1), 30);
     xlabel ("Value");
     ylabel ("Count");
     title ("Histogram of 10,000 normally distributed random numbers");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "errorbar"))
     rand ("state", 2);
     x = 0:0.1:10;
@@ -56,11 +57,11 @@
     xlabel ("x");
     ylabel ("sin (x)");
     title ("Errorbar plot of sin (x)");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "polar"))
     polar (0:0.1:10*pi, 0:0.1:10*pi);
     title ("Example polar plot from 0 to 10*pi");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "mesh"))
     tx = ty = linspace (-8, 8, 41)';
     [xx, yy] = meshgrid (tx, ty);
@@ -71,7 +72,7 @@
     ylabel ("ty");
     zlabel ("tz");
     title ("3-D Sombrero plot");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "plot3"))
     t = 0:0.1:10*pi;
     r = linspace (0, 1, numel (t));
@@ -81,7 +82,7 @@
     ylabel ("r.*cos (t)");
     zlabel ("z");
     title ("plot3 display of 3-D helix");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "extended"))
     x = 0:0.01:3;
     plot (x,erf(x));
@@ -93,7 +94,7 @@
     xlabel ("x");
     ylabel ("erf (x)");
     title ("erf (x) with text annotation");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   else
     error ("unrecognized plot requested");
   endif
@@ -118,8 +119,8 @@
 endfunction
 
 ## generate something for the texinfo @image command to process
-function image_as_txt(nm)
-  fid = fopen (sprintf ("%s.txt", nm), "wt");
+function image_as_txt(d, nm)
+  fid = fopen (fullfile (d, strcat (nm, ".txt")), "wt");
   fputs (fid, "\n");
   fputs (fid, "+---------------------------------+\n");
   fputs (fid, "| Image unavailable in text mode. |\n");
--- a/doc/interpreter/sparseimages.m	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/sparseimages.m	Fri Jul 03 19:33:19 2015 -0400
@@ -16,7 +16,7 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-function sparseimages (nm, typ)
+function sparseimages (d, nm, typ)
   graphics_toolkit ("gnuplot");
   set_print_size ();
   if (strcmp (typ, "png"))
@@ -27,19 +27,19 @@
       && __have_feature__ ("CHOLMOD")
       && __have_feature__ ("UMFPACK"))
     if (strcmp (typ,"txt"))
-      txtimages (nm, 15, typ);
+      txtimages (d, nm, 15, typ);
     else
       if (strcmp (nm, "gplot"))
-        gplotimages ("gplot", typ);
+        gplotimages (d, "gplot", typ);
       elseif (strcmp (nm, "grid"))
-        femimages ("grid", typ);
+        femimages (d, "grid", typ);
       else
-        otherimages (nm, 200, typ);
+        otherimages (d, nm, 200, typ);
       endif
     endif
   else ## There is no sparse matrix implementation available because
        ## of missing libraries, plot sombreros instead
-    sombreroimage (nm, typ);
+    sombreroimage (d, nm, typ);
   endif
 endfunction
 
@@ -57,8 +57,9 @@
   set (f, "visible", "off");
 endfunction
 
-function gplotimages (nm, typ)
+function gplotimages (d, nm, typ)
   hide_output ();
+  outfile = fullfile (d, strcat (nm, ".", typ));
   if (strcmp (typ, "eps"))
     d_typ = "-depsc2";
   else
@@ -69,38 +70,40 @@
               [1,1,2,2,3,3,4,4,5,5,6,6], 1, 6, 6);
   xy = [0,4,8,6,4,2;5,0,5,7,5,7]';
   gplot (A, xy);
-  print ([nm "." typ], d_typ);
+  print (outfile, d_typ);
   hide_output ();
 endfunction
 
-function txtimages (nm, n, typ)
+function txtimages (d, nm, n, typ)
+  outfile = fullfile (d, strcat (nm, ".", typ));
   a = 10*speye (n) + sparse (1:n,ceil([1:n]/2),1,n,n) + ...
       sparse (ceil ([1:n]/2),1:n,1,n,n);
   if (strcmp (nm, "gplot") || strcmp (nm, "grid"))
-    fid = fopen (sprintf ("%s.txt", nm), "wt");
+    fid = fopen (fullfile (d, strcat (nm, ".txt")), "wt");
     fputs (fid, "\n");
     fputs (fid, "+---------------------------------+\n");
     fputs (fid, "| Image unavailable in text mode. |\n");
     fputs (fid, "+---------------------------------+\n");
     fclose (fid);
   elseif (strcmp (nm, "spmatrix"))
-    printsparse (a, ["spmatrix." typ]);
+    printsparse (a, outfile);
   else
     if (__have_feature__ ("COLAMD") && __have_feature__ ("CHOLMOD"))
       if (strcmp (nm, "spchol"))
         r1 = chol (a);
-        printsparse (r1, ["spchol." typ]);
+        printsparse (r1, outfile);
       elseif (strcmp (nm, "spcholperm"))
         [r2,p2,q2] = chol (a);
-        printsparse(r2, ["spcholperm." typ]);
+        printsparse(r2, outfile);
       endif
       ## printf("Text NNZ: Matrix %d, Chol %d, PermChol %d\n",nnz(a),nnz(r1),nnz(r2));
     endif
   endif
 endfunction
 
-function otherimages (nm, n, typ)
+function otherimages (d, nm, n, typ)
   hide_output ();
+  outfile = fullfile (d, strcat (nm, ".", typ));
   if (strcmp (typ, "eps"))
     d_typ = "-depsc2";
   else
@@ -112,7 +115,7 @@
   if (strcmp (nm, "spmatrix"))
     spy (a);
     axis ("ij");
-    print (["spmatrix." typ], d_typ);
+    print (outfile, d_typ);
     hide_output ();
   else
     if (__have_feature__ ("COLAMD") && __have_feature__ ("CHOLMOD"))
@@ -120,13 +123,13 @@
         r1 = chol (a);
         spy (r1);
         axis ("ij");
-        print (["spchol." typ], d_typ);
+        print (outfile, d_typ);
         hide_output ();
       elseif (strcmp (nm, "spcholperm"))
         [r2,p2,q2] = chol (a);
         spy (r2);
         axis ("ij");
-        print (["spcholperm." typ], d_typ);
+        print (outfile, d_typ);
         hide_output ();
       endif
       ## printf("Image NNZ: Matrix %d, Chol %d, PermChol %d\n",nnz(a),nnz(r1),nnz(r2));
@@ -172,8 +175,9 @@
   fclose (fid);
 endfunction
 
-function femimages (nm, typ)
+function femimages (d, nm, typ)
   hide_output ();
+  outfile = fullfile (d, strcat (nm, ".", typ));
   if (strcmp (typ, "eps"))
     d_typ = "-depsc2";
   else
@@ -253,7 +257,7 @@
 
     plot3 (xelems, yelems, velems);
     view (80, 10);
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
     hide_output ();
   endif
 endfunction
@@ -261,9 +265,9 @@
 ## There is no sparse matrix implementation available because of missing
 ## libraries, plot sombreros instead. Also plot a nice title that we are
 ## sorry about that.
-function sombreroimage (nm, typ)
+function sombreroimage (d, nm, typ)
   if (strcmp (typ, "txt"))
-    fid = fopen (sprintf ("%s.txt", nm), "wt");
+    fid = fopen (fullfile (d, strcat (nm, ".txt")), "wt");
     fputs (fid, "\n");
     fputs (fid, "+---------------------------------------+\n");
     fputs (fid, "| Image unavailable because of a        |\n");
@@ -285,19 +289,9 @@
       mesh (x, y, z);
       title ("Sorry, graphics are unavailable because Octave was\ncompiled without a sparse matrix implementation.");
     unwind_protect_cleanup
-      print ([nm "." typ], d_typ);
+      print (outfile, d_typ);
       hide_output ();
     end_unwind_protect
   endif
 endfunction
 
-## generate something for the texinfo @image command to process
-function image_as_txt (nm)
-  fid = fopen (sprintf ("%s.txt", nm), "wt");
-  fputs (fid, "\n");
-  fputs (fid, "+---------------------------------+\n");
-  fputs (fid, "| Image unavailable in text mode. |\n");
-  fputs (fid, "+---------------------------------+\n");
-  fclose (fid);
-endfunction
-
--- a/doc/interpreter/splineimages.m	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/interpreter/splineimages.m	Fri Jul 03 19:33:19 2015 -0400
@@ -16,10 +16,11 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-function splineimages (nm, typ)
+function splineimages (d, nm, typ)
   graphics_toolkit ("gnuplot");
   set_print_size ();
   hide_output ();
+  outfile = fullfile (d, strcat (nm, ".", typ));
   if (strcmp (typ, "png"))
     set (0, "defaulttextfontname", "*");
   endif
@@ -30,7 +31,7 @@
   endif
 
   if (strcmp (typ, "txt"))
-    image_as_txt (nm);
+    image_as_txt (d, nm);
   elseif (strcmp (nm, "splinefit1")) ## Breaks and Pieces
     x = 2 * pi * rand (1, 200);
     y = sin (x) + sin (2 * x) + 0.2 * randn (size (x));
@@ -47,7 +48,7 @@
     axis tight;
     ylim ([-2.5 2.5]);
     legend ("data", "41 breaks, 40 pieces", "11 breaks, 10 pieces");
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "splinefit2")) ## Spline orders
     ## Data (200 points)
     x = 2 * pi * rand (1, 200);
@@ -69,7 +70,7 @@
     axis tight;
     ylim ([-2.5 2.5]);
     legend ({"data", "order 0", "order 1", "order 2", "order 3", "order 4"});
-    print ([nm, "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "splinefit3"))
     ## Data (100 points)
     x = 2 * pi * [0, (rand (1, 98)), 1];
@@ -86,7 +87,7 @@
     axis tight;
     ylim ([-2 3]);
     legend ({"data", "no constraints", "periodic"});
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "splinefit4"))
     ## Data (200 points)
     x = 2 * pi * rand (1, 200);
@@ -109,7 +110,7 @@
     axis tight;
     ylim ([-1.5 1.5]);
     legend({"data", "clamped", "hinged periodic"});
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "splinefit5"))
     ## Truncated data
     x = [0,  1,  2,  4,  8, 16, 24, 40, 56, 72, 80] / 80;
@@ -130,7 +131,7 @@
     legend ({"data", "spline", "breaks"});
     axis tight;
     ylim ([0 0.1]);
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   elseif (strcmp (nm, "splinefit6"))
     ## Data
     x = linspace (0, 2*pi, 200);
@@ -153,7 +154,7 @@
              "robust, beta = 0.75", "no robust fitting"});
     axis tight;
     ylim ([-2 2]);
-    print ([nm "." typ], d_typ);
+    print (outfile, d_typ);
   endif
   hide_output ();
 endfunction
@@ -176,8 +177,8 @@
 endfunction
 
 ## generate something for the texinfo @image command to process
-function image_as_txt(nm)
-  fid = fopen (sprintf ("%s.txt", nm), "wt");
+function image_as_txt(d, nm)
+  fid = fopen (fullfile (d, strcat (nm, ".txt")), "wt");
   fputs (fid, "\n");
   fputs (fid, "+---------------------------------+\n");
   fputs (fid, "| Image unavailable in text mode. |\n");
--- a/doc/liboctave/Makefile.am	Fri Jul 03 07:51:51 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-# Makefile for Octave's doc/liboctave directory
-#
-# Copyright (C) 1996-2015 John W. Eaton
-#
-# This file is part of Octave.
-#
-# Octave is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 3 of the License, or (at
-# your option) any later version.
-#
-# Octave is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Octave; see the file COPYING.  If not, see
-# <http://www.gnu.org/licenses/>.
-
-include $(top_srcdir)/build-aux/common.mk
-
-TEXINFO_TEX = ../texinfo.tex
-
-info_TEXINFOS = liboctave.texi
-
-liboctave_TEXINFOS = \
-  array.texi \
-  bugs.texi \
-  cp-idx.texi \
-  dae.texi \
-  diffeq.texi \
-  error.texi \
-  factor.texi \
-  fn-idx.texi \
-  gpl.texi \
-  install.texi \
-  intro.texi \
-  matvec.texi \
-  nleqn.texi \
-  nlfunc.texi \
-  ode.texi \
-  optim.texi \
-  preface.texi \
-  quad.texi \
-  range.texi
-
-all-local: dvi html pdf ps
-
-## The texi2dvi script (used to create both PDF and DVI output formats)
-## uses some fixed temporary file names.  In order to avoid a race condition
-## the DVI and PDF builds are forced to run serially through a Makefile rule.
-liboctave.pdf: liboctave.dvi
-
-EXTRA_DIST = liboctave.dvi liboctave.html liboctave.pdf liboctave.ps
-
-clean-local:
-	rm -rf t2d_cache
-
--- a/doc/liboctave/liboctave.texi	Fri Jul 03 07:51:51 2015 -0400
+++ b/doc/liboctave/liboctave.texi	Fri Jul 03 19:33:19 2015 -0400
@@ -50,7 +50,7 @@
 @c The version.texi file doesn't include a chapter, so it must not be
 @c included if you want to run the Emacs function
 @c texinfo-multiple-files-update.
-@include version.texi
+@include version-liboctave.texi
 
 @settitle Octave C++ Classes
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/module.mk	Fri Jul 03 19:33:19 2015 -0400
@@ -0,0 +1,500 @@
+TEXINFO_TEX = doc/texinfo.tex
+
+TEXINPUTS := $(PATH_SEPARATOR)$(top_srcdir)/doc/interpreter$(PATH_SEPARATOR)$(PATH_SEPARATOR)$(top_builddir)/doc/interpreter$(PATH_SEPARATOR)$(TEXINPUTS)$(PATH_SEPARATOR)
+export TEXINPUTS
+
+TEXMFCNF := $(PATH_SEPARATOR)$(top_srcdir)/doc$(PATH_SEPARATOR)$(top_builddir)/doc$(PATH_SEPARATOR)$(TEXMFCNF)$(PATH_SEPARATOR)
+export TEXMFCNF
+
+DVIPS = dvips
+TEX = tex
+PDFTEX = pdftex
+
+AM_V_TEX = $(am__v_TEX_$(V))
+am__v_TEX_ = $(am__v_TEX_$(AM_DEFAULT_VERBOSITY))
+am__v_TEX_0 = @echo "  TEX     " $@;
+am__v_TEX_1 = 
+
+AM_V_PDFTEX = $(am__v_PDFTEX_$(V))
+am__v_PDFTEX_ = $(am__v_PDFTEX_$(AM_DEFAULT_VERBOSITY))
+am__v_PDFTEX_0 = @echo "  PDFTEX  " $@;
+am__v_PDFTEX_1 = 
+
+if AMCOND_BUILD_DOCS
+
+## Listing "dvi" explicitly here seems to cause two simultaneous
+## builds of the DVI files, presumably because the PS version
+## also depends on the DVI file and somehow the rules are invoked
+## twice.  Is that a bug in automake or make or what?
+
+DOC_TARGETS = \
+  doc/interpreter/doc-cache
+
+EXTRA_DIST += \
+  doc/texinfo.tex \
+  doc/texmf.cnf
+
+EXTRA_DIST += \
+  doc/doxyhtml/Doxyfile.in \
+  doc/doxyhtml/README
+
+doxyhtml: doxyhtml/$(octave_dirstamp)
+	doxygen doxyhtml/Doxyfile
+
+doxyhtml-maintainer-clean:
+	rm -rf `ls doc/doxyhtml | $(GREP) -v Doxyfile`
+
+DIRSTAMP_FILES += doxyhtml/$(octave_dirstamp)
+
+GRAPH_PROP_TEXI_SRC = \
+  doc/interpreter/plot-axesproperties.texi \
+  doc/interpreter/plot-figureproperties.texi \
+  doc/interpreter/plot-imageproperties.texi \
+  doc/interpreter/plot-lineproperties.texi \
+  doc/interpreter/plot-patchproperties.texi \
+  doc/interpreter/plot-rootproperties.texi \
+  doc/interpreter/plot-surfaceproperties.texi \
+  doc/interpreter/plot-textproperties.texi
+
+define gen-propdoc-texi
+  rm -f $@-t $@ && \
+  $(top_builddir)/run-octave -f -q -H -p $(srcdir)/doc/interpreter --eval "genpropdoc ('$(1)');" > $@-t && \
+  mv $@-t $@
+endef
+
+doc/interpreter/plot-axesproperties.texi: doc/interpreter/genpropdoc.m
+	$(AM_V_GEN)$(call gen-propdoc-texi,axes)
+
+doc/interpreter/plot-figureproperties.texi: doc/interpreter/genpropdoc.m
+	$(AM_V_GEN)$(call gen-propdoc-texi,figure)
+
+doc/interpreter/plot-imageproperties.texi: doc/interpreter/genpropdoc.m
+	$(AM_V_GEN)$(call gen-propdoc-texi,image)
+
+doc/interpreter/plot-lineproperties.texi: doc/interpreter/genpropdoc.m
+	$(AM_V_GEN)$(call gen-propdoc-texi,line)
+
+doc/interpreter/plot-patchproperties.texi: doc/interpreter/genpropdoc.m
+	$(AM_V_GEN)$(call gen-propdoc-texi,patch)
+
+doc/interpreter/plot-rootproperties.texi: doc/interpreter/genpropdoc.m
+	$(AM_V_GEN)$(call gen-propdoc-texi,root)
+
+doc/interpreter/plot-surfaceproperties.texi: doc/interpreter/genpropdoc.m
+	$(AM_V_GEN)$(call gen-propdoc-texi,surface)
+
+doc/interpreter/plot-textproperties.texi: doc/interpreter/genpropdoc.m
+	$(AM_V_GEN)$(call gen-propdoc-texi,text)
+
+dist_man_MANS = \
+  doc/interpreter/mkoctfile.1 \
+  doc/interpreter/octave-cli.1 \
+  doc/interpreter/octave-config.1 \
+  doc/interpreter/octave.1
+
+JAVA_IMAGES = \
+  doc/interpreter/java-images/image001.png \
+  doc/interpreter/java-images/image002.png \
+  doc/interpreter/java-images/image003.png \
+  doc/interpreter/java-images/image004.png \
+  doc/interpreter/java-images/image005.png \
+  doc/interpreter/java-images/image006.png \
+  doc/interpreter/java-images/image007.png \
+  doc/interpreter/java-images/image008.png \
+  doc/interpreter/java-images/image009.png
+
+BUILT_IMAGES = \
+  $(IMAGES_EPS) \
+  $(IMAGES_PDF) \
+  $(IMAGES_PNG) \
+  $(IMAGES_TXT)
+
+IMAGES = \
+  $(BUILT_IMAGES) \
+  $(JAVA_IMAGES)
+
+## FIXME: JAVA_IMAGES will eventually need to be added to the HTML build.
+##        It will require a different Makefile rule later because
+##        JAVA_IMAGES live in a subdir rather than in the current directory.
+
+HTMLDIR_IMAGES = $(patsubst doc/interpreter/%.png, doc/interpreter/octave.html/%.png, $(IMAGES_PNG))
+
+LOGOS = \
+  doc/interpreter/octave_logo.eps \
+  doc/interpreter/octave_logo.pdf
+
+IMAGES_EPS += doc/interpreter/octave_logo.eps
+IMAGES_PDF += doc/interpreter/octave_logo.pdf
+
+MUNGED_TEXI_SRC = \
+  doc/interpreter/arith.texi \
+  doc/interpreter/audio.texi \
+  doc/interpreter/basics.texi \
+  doc/interpreter/bugs.texi \
+  doc/interpreter/container.texi \
+  doc/interpreter/contrib.texi \
+  doc/interpreter/cp-idx.texi \
+  doc/interpreter/data.texi \
+  doc/interpreter/debug.texi \
+  doc/interpreter/diffeq.texi \
+  doc/interpreter/diagperm.texi \
+  doc/interpreter/external.texi \
+  doc/interpreter/emacs.texi \
+  doc/interpreter/errors.texi \
+  doc/interpreter/eval.texi \
+  doc/interpreter/expr.texi \
+  doc/interpreter/fn-idx.texi \
+  doc/interpreter/func.texi \
+  doc/interpreter/geometry.texi \
+  doc/interpreter/gui.texi \
+  doc/interpreter/gpl.texi \
+  doc/interpreter/grammar.texi \
+  doc/interpreter/image.texi \
+  doc/interpreter/install.texi \
+  doc/interpreter/interp.texi \
+  doc/interpreter/intro.texi \
+  doc/interpreter/io.texi \
+  doc/interpreter/java.texi \
+  doc/interpreter/linalg.texi \
+  doc/interpreter/matrix.texi \
+  doc/interpreter/nonlin.texi \
+  doc/interpreter/numbers.texi \
+  doc/interpreter/obsolete.texi \
+  doc/interpreter/oop.texi \
+  doc/interpreter/op-idx.texi \
+  doc/interpreter/optim.texi \
+  doc/interpreter/package.texi \
+  doc/interpreter/plot.texi \
+  doc/interpreter/poly.texi \
+  doc/interpreter/preface.texi \
+  doc/interpreter/quad.texi \
+  doc/interpreter/set.texi \
+  doc/interpreter/signal.texi \
+  doc/interpreter/sparse.texi \
+  doc/interpreter/stats.texi \
+  doc/interpreter/stmt.texi \
+  doc/interpreter/strings.texi \
+  doc/interpreter/system.texi \
+  doc/interpreter/testfun.texi \
+  doc/interpreter/tips.texi \
+  doc/interpreter/var.texi \
+  doc/interpreter/vectorize.texi
+
+TXI_SRC = $(MUNGED_TEXI_SRC:.texi=.txi)
+
+BUILT_OCTAVE_TEXI_SRC = \
+  doc/interpreter/contributors.texi \
+  $(GRAPH_PROP_TEXI_SRC) \
+  $(MUNGED_TEXI_SRC)
+
+info_TEXINFOS += \
+  doc/interpreter/octave.texi
+
+## The $(examples_code_SRC) files are included here because
+## they are included in the manual via the @EXAMPLEFILE macro,
+## so they are dependencies for the documentation.
+
+octave_TEXINFOS = \
+  $(BUILT_OCTAVE_TEXI_SRC) \
+  $(examples_code_SRC)
+
+## As of version 1.14.1, automake does not seem to generate
+## rules for DVI, PDF, or HTML output that work for us when
+## there are additional dependencies, so we include our own
+## versions of the rules here.
+
+$(srcdir)/doc/interpreter/octave.info: $(IMAGES_TXT) $(octave_TEXINFOS)
+doc/interpreter/octave.dvi: $(IMAGES_EPS) $(octave_TEXINFOS)
+doc/interpreter/octave.pdf: $(IMAGES_PDF) $(octave_TEXINFOS)
+doc/interpreter/octave.html: $(IMAGES_PNG) $(octave_TEXINFOS)
+
+$(srcdir)/doc/interpreter/octave.info: doc/interpreter/octave.texi $(srcdir)/doc/interpreter/version-octave.texi
+	$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+	am__cwd=`pwd` && $(am__cd) $(srcdir) && \
+	rm -rf $$backupdir && mkdir $$backupdir && \
+	if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
+	  for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+	    if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
+	  done; \
+	else :; fi && \
+	cd "$$am__cwd"; \
+	if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc/interpreter -I $(srcdir)/doc/interpreter \
+	 -o $@ $(srcdir)/doc/interpreter/octave.texi; \
+	then \
+	  rc=0; \
+	  $(am__cd) $(srcdir); \
+	else \
+	  rc=$$?; \
+	  $(am__cd) $(srcdir) && \
+	  $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+	fi; \
+	rm -rf $$backupdir; exit $$rc
+
+doc/interpreter/octave.dvi: doc/interpreter/octave.texi $(srcdir)/doc/interpreter/version-octave.texi doc/interpreter/$(am__dirstamp)
+	$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc/interpreter -I $(srcdir)/doc/interpreter' \
+	$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
+	`test -f 'doc/interpreter/octave.texi' || echo '$(srcdir)/'`doc/interpreter/octave.texi
+
+doc/interpreter/octave.pdf: doc/interpreter/octave.texi $(srcdir)/doc/interpreter/version-octave.texi doc/interpreter/$(am__dirstamp)
+	$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc/interpreter -I $(srcdir)/doc/interpreter' \
+	$(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
+	`test -f 'doc/interpreter/octave.texi' || echo '$(srcdir)/'`doc/interpreter/octave.texi
+
+OCTAVE_HTML_DIR = doc/interpreter/octave.html
+OCTAVE_HTML_TMP_DIR = $(OCTAVE_HTML_DIR:.html=.htp)
+OCTAVE_HTML_STAMP = $(OCTAVE_HTML_DIR)/.html-stamp
+
+$(OCTAVE_HTML_STAMP): doc/interpreter/octave.texi $(srcdir)/doc/interpreter/version-octave.texi doc/interpreter/$(am__dirstamp)
+	$(AM_V_MAKEINFO)rm -rf $(OCTAVE_HTML_DIR)
+	$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc/interpreter -I $(srcdir)/doc/interpreter \
+	 -o $(OCTAVE_HTML_TMP_DIR) `test -f 'doc/interpreter/octave.texi' || echo '$(srcdir)/'`doc/interpreter/octave.texi; \
+	then \
+	  rm -rf $(OCTAVE_HTML_DIR)@ && \
+	  mv $(OCTAVE_HTML_TMP_DIR) $(OCTAVE_HTML_DIR) && \
+	  touch $@; \
+	else \
+	  rm -rf $(OCTAVE_HTML_TMP_DIR); exit 1; \
+	fi
+
+$(HTMLDIR_IMAGES) : doc/interpreter/octave.html/%.png: doc/interpreter/%.png $(OCTAVE_HTML_STAMP)
+	$(AM_V_GEN)cp $< $@
+
+DOC_TARGETS += \
+  $(srcdir)/doc/interpreter/octave.info \
+  doc/interpreter/octave.ps \
+  doc/interpreter/octave.pdf \
+  $(OCTAVE_HTML_STAMP) \
+  $(HTMLDIR_IMAGES)
+
+## The texi2dvi script (used to create both PDF and DVI output formats)
+## uses some fixed temporary file names.  In order to avoid a race condition
+## the DVI and PDF builds are forced to run serially through a Makefile rule.
+#doc/interpreter/octave.pdf: doc/interpreter/octave.dvi
+
+# Prevent packaging of distribution unless all libraries
+# necessary to create documentation are present
+doc-interpreter-dist-hook:
+	@$(GREP) '#define HAVE_COLAMD 1' $(top_builddir)/config.h > /dev/null || { echo "Documentation creation requires missing COLAMD library.  Cannot package distribution!" ; exit 1; }
+	@$(GREP) '#define HAVE_CHOLMOD 1' $(top_builddir)/config.h > /dev/null || { echo "Documentation creation requires missing CHOLMOD library.  Cannot package distribution!" ; exit 1; }
+	@$(GREP) '#define HAVE_UMFPACK 1' $(top_builddir)/config.h > /dev/null || { echo "Documentation creation requires missing UMFPACK library.  Cannot package distribution!" ; exit 1; }
+	@$(GREP) '#define HAVE_QHULL 1' $(top_builddir)/config.h > /dev/null || { echo "Documentation creation requires missing QHULL library.  Cannot package distribution!" ; exit 1; }
+
+octetc_DATA += \
+  doc/interpreter/doc-cache \
+  doc/interpreter/macros.texi
+
+DOCSTRING_FILES = $(shell $(srcdir)/doc/interpreter/find-docstring-files.sh "$(top_srcdir)")
+
+doc/interpreter/doc-cache: $(DOCSTRING_FILES) doc/interpreter/mk_doc_cache.m doc/interpreter/$(octave_dirstamp)
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(top_builddir)/run-octave -f -q -H $(srcdir)/doc/interpreter/mk_doc_cache.m - $(srcdir)/doc/interpreter/macros.texi $(DOCSTRING_FILES) >$@-t && \
+	mv $@-t $@
+
+$(MUNGED_TEXI_SRC): $(DOCSTRING_FILES) $(munge_texi_SOURCES)
+
+%.texi : %.txi doc/interpreter/munge-texi.pl doc/interpreter/$(octave_dirstamp)
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(PERL) $(srcdir)/doc/interpreter/munge-texi.pl $(top_srcdir) $(DOCSTRING_FILES) < $< > $@-t && \
+	mv $@-t $@
+
+doc/interpreter/contributors.texi: doc/interpreter/contributors.in doc/interpreter/$(octave_dirstamp)
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(AWK) -f $(srcdir)/doc/interpreter/mkcontrib.awk $(srcdir)/doc/interpreter/contributors.in > $@-t && \
+	mv $@-t $@
+
+AUTHORS: doc/interpreter/preface.texi doc/interpreter/contributors.texi doc/interpreter/$(octave_dirstamp)
+	$(AM_V_MAKEINFO)rm -f $@-t $@ && \
+	if [ "x$(srcdir)" != "x." ] && [ -f $(srcdir)/doc/interpreter/contributors.texi ] && [ ! -f doc/interpreter/contributors.texi ]; then \
+		cp $(srcdir)/doc/interpreter/contributors.texi doc/interpreter/contributors.texi; \
+		touch -r $(srcdir)/doc/interpreter/contributors.texi doc/interpreter/contributors.texi; \
+	fi && \
+	$(MAKEINFO) -D AUTHORSONLY -I $(srcdir)/doc/interpreter/ \
+	  --no-validate --no-headers --no-split --output $@-t $< && \
+	mv $@-t $@
+
+BUGS: doc/interpreter/bugs.texi doc/interpreter/$(octave_dirstamp)
+	$(AM_V_MAKEINFO)rm -f $@-t $@ && \
+	$(MAKEINFO) -D BUGSONLY -I $(srcdir)/doc/interpreter \
+	  --no-validate --no-headers --no-split --output doc/interpreter/BUGS $< && \
+	mv $@-t $@
+
+INSTALL.OCTAVE: doc/interpreter/install.texi doc/interpreter/$(octave_dirstamp)
+	$(AM_V_MAKEINFO)rm -f $@-t $@ && \
+	$(MAKEINFO) -D INSTALLONLY -I $(srcdir)/doc/interpreter \
+	  --no-validate --no-headers --no-split --output doc/interpreter/INSTALL $< && \
+	mv $@-t $@
+
+EXTRA_DIST += \
+  doc/interpreter/config-images.sh \
+  doc/interpreter/contributors.in \
+  doc/interpreter/doc-cache \
+  doc/interpreter/find-docstring-files.sh \
+  doc/interpreter/genpropdoc.m \
+  doc/interpreter/graphics_properties.mk \
+  doc/interpreter/images \
+  doc/interpreter/images.awk \
+  doc/interpreter/images.mk \
+  doc/interpreter/macros.texi \
+  doc/interpreter/mk_doc_cache.m \
+  doc/interpreter/mkcontrib.awk \
+  doc/interpreter/munge-texi.pl \
+  $(IMAGES) \
+  $(IMAGES_SRC) \
+  $(LOGOS) \
+  $(TXI_SRC)
+
+interpreter-clean:
+	rm -rf t2d_cache
+
+DISTCLEANFILES += \
+  $(BUILT_TEXINFOS) \
+  $(OCTAVE_HTML_STAMP)
+
+MAINTAINERCLEANFILES += \
+  $(BUILT_IMAGES) \
+  doc/interpreter/doc-cache
+
+DIRSTAMP_FILES += doc/interpreter/$(octave_dirstamp)
+
+liboctave_TEXINFOS = \
+  doc/liboctave/array.texi \
+  doc/liboctave/bugs.texi \
+  doc/liboctave/cp-idx.texi \
+  doc/liboctave/dae.texi \
+  doc/liboctave/diffeq.texi \
+  doc/liboctave/error.texi \
+  doc/liboctave/factor.texi \
+  doc/liboctave/fn-idx.texi \
+  doc/liboctave/gpl.texi \
+  doc/liboctave/install.texi \
+  doc/liboctave/intro.texi \
+  doc/liboctave/matvec.texi \
+  doc/liboctave/nleqn.texi \
+  doc/liboctave/nlfunc.texi \
+  doc/liboctave/ode.texi \
+  doc/liboctave/optim.texi \
+  doc/liboctave/preface.texi \
+  doc/liboctave/quad.texi \
+  doc/liboctave/range.texi
+
+info_TEXINFOS += \
+  doc/liboctave/liboctave.texi
+
+DOC_TARGETS += \
+  $(srcdir)/doc/liboctave/liboctave.info \
+  doc/liboctave/liboctave.ps \
+  doc/liboctave/liboctave.pdf \
+  doc/liboctave/liboctave.html
+
+## The texi2dvi script (used to create both PDF and DVI output formats)
+## uses some fixed temporary file names.  In order to avoid a race condition
+## the DVI and PDF builds are forced to run serially through a Makefile rule.
+#doc/liboctave/liboctave.pdf: doc/liboctave/liboctave.dvi
+
+liboctave-clean:
+	rm -rf doc/liboctave/t2d_cache
+
+DIRSTAMP_FILES += doc/liboctave/$(octave_dirstamp)
+
+refcard_TEX_SRC = \
+  doc/refcard/refcard.tex \
+  doc/refcard/refcard-a4.tex \
+  doc/refcard/refcard-legal.tex \
+  doc/refcard/refcard-letter.tex
+
+refcard_DVI = \
+  doc/refcard/refcard-a4.dvi \
+  doc/refcard/refcard-legal.dvi \
+  doc/refcard/refcard-letter.dvi
+
+refcard_PDF = \
+  doc/refcard/refcard-a4.pdf \
+  doc/refcard/refcard-legal.pdf \
+  doc/refcard/refcard-letter.pdf
+
+refcard_PS = \
+  doc/refcard/refcard-letter.ps \
+  doc/refcard/refcard-a4.ps \
+  doc/refcard/refcard-legal.ps
+
+refcard_FORMATTED = \
+  $(refcard_DVI) \
+  $(refcard_PDF) \
+  $(refcard_PS)
+
+DOC_TARGETS += \
+  $(refcard_FORMATTED)
+
+doc/refcard/refcard-a4.pdf: doc/refcard/refcard.tex
+doc/refcard/refcard-a4.dvi: doc/refcard/refcard.tex
+doc/refcard/refcard-a4.ps: doc/refcard/refcard-a4.dvi
+	-$(AM_V_DVIPS)$(DVIPS) $(AM_V_texinfo) -T 297mm,210mm -o $@ $<
+
+doc/refcard/refcard-legal.pdf: doc/refcard/refcard.tex
+doc/refcard/refcard-legal.dvi: doc/refcard/refcard.tex
+doc/refcard/refcard-legal.ps: doc/refcard/refcard-legal.dvi
+	-$(AM_V_DVIPS)$(DVIPS) $(AM_V_texinfo) -T 14in,8.5in -o $@ $<
+
+doc/refcard/refcard-letter.pdf: doc/refcard/refcard.tex
+doc/refcard/refcard-letter.dvi: doc/refcard/refcard.tex
+doc/refcard/refcard-letter.ps: doc/refcard/refcard-letter.dvi
+	-$(AM_V_DVIPS)$(DVIPS) $(AM_V_texinfo) -T 11in,8.5in -o $@ $<
+
+EXTRA_DIST += \
+  $(refcard_TEX_SRC) \
+  $(refcard_FORMATTED)
+
+CLEANFILES += \
+  doc/refcard/refcard-a4.log \
+  doc/refcard/refcard-legal.log \
+  doc/refcard/refcard-letter.log
+
+MAINTAINERCLEANFILES += \
+  $(refcard_FORMATTED)
+
+DIRSTAMP_FILES += doc/refcard/$(octave_dirstamp)
+
+clean-local: interpreter-clean
+
+maintainer-clean-local: doxyhtml-maintainer-clean
+
+$(srcdir)/doc/interpreter/images.mk: $(srcdir)/doc/interpreter/config-images.sh $(srcdir)/doc/interpreter/images.awk $(srcdir)/doc/interpreter/images
+	$(srcdir)/doc/interpreter/config-images.sh $(top_srcdir)
+
+$(refcard_DVI) : %.dvi : %.tex doc/refcard/$(octave_dirstamp)
+	-$(AM_V_TEX)cd $(@D) && \
+	TEXINPUTS="$(srcdir)/doc/refcard:$(TEXINPUTS):" \
+	$(TEX) $< $(AM_V_texidevnull)
+
+$(refcard_PDF) : %.pdf : %.tex doc/refcard/$(octave_dirstamp)
+	-$(AM_V_PDFTEX)cd $(@D) && \
+	TEXINPUTS="$(srcdir)/doc/refcard:$(TEXINPUTS):" \
+	$(PDFTEX) $< $(AM_V_texidevnull)
+
+endif
+
+doc/interpreter/undocumented_list:
+	rm -f $@-t $@
+	-$(PERL) $(srcdir)/doccheck/mk_undocumented_list > $@-t
+	mv $@-t $@
+.PHONY: doc/interpreter/undocumented_list
+
+SPELLCHECK_FILES = $(MUNGED_TEXI_SRC:.texi=.scheck)
+
+%.scheck: %.texi doc/interpreter/$(octave_dirstamp)
+	$(srcdir)/doc/interpreter/doccheck/spellcheck $< > $@-t
+	mv $@-t $@
+	[ -s $@ ] || rm -f $@
+
+spellcheck: $(SPELLCHECK_FILES)
+	@if ls *.scheck >/dev/null 2>&1 ; then \
+		echo "Spellcheck failed"; \
+		echo "Review the following files:"; \
+		ls *.scheck ; \
+		exit 1 ; \
+	else \
+		echo "Spellcheck passed"; \
+	fi
+.PHONY: spellcheck
--- a/doc/refcard/Makefile.am	Fri Jul 03 07:51:51 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-# Makefile for Octave's doc/refcard directory
-#
-# Copyright (C) 1996-2015 John W. Eaton
-#
-# This file is part of Octave.
-#
-# Octave is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 3 of the License, or (at
-# your option) any later version.
-#
-# Octave is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Octave; see the file COPYING.  If not, see
-# <http://www.gnu.org/licenses/>.
-
-include $(top_srcdir)/build-aux/common.mk
-
-DVIPS = dvips
-TEX = tex
-PDFTEX = pdftex
-
-AM_V_TEX = $(am__v_TEX_$(V))
-am__v_TEX_ = $(am__v_TEX_$(AM_DEFAULT_VERBOSITY))
-am__v_TEX_0 = @echo "  TEX     " $@;
-am__v_TEX_1 = 
-
-AM_V_PDFTEX = $(am__v_PDFTEX_$(V))
-am__v_PDFTEX_ = $(am__v_PDFTEX_$(AM_DEFAULT_VERBOSITY))
-am__v_PDFTEX_0 = @echo "  PDFTEX  " $@;
-am__v_PDFTEX_1 = 
-
-## The following three blocks of variable definitions can be eliminated
-## if we merge the makefiles in teh doc directory.
-
-AM_V_texidevnull = $(am__v_texidevnull_$(V))
-am__v_texidevnull_ = $(am__v_texidevnull_$(AM_DEFAULT_VERBOSITY))
-am__v_texidevnull_0 = > /dev/null
-am__v_texidevnull_1 = 
-
-AM_V_DVIPS = $(am__v_DVIPS_$(V))
-am__v_DVIPS_ = $(am__v_DVIPS_$(AM_DEFAULT_VERBOSITY))
-am__v_DVIPS_0 = @echo "  DVIPS   " $@;
-am__v_DVIPS_1 =
-
-AM_V_texinfo = $(am__v_texinfo_$(V))
-am__v_texinfo_ = $(am__v_texinfo_$(AM_DEFAULT_VERBOSITY))
-am__v_texinfo_0 = -q
-am__v_texinfo_1 = 
-
-%.dvi : %.tex
-	-$(AM_V_TEX)TEXINPUTS="$(srcdir):$(TEXINPUTS):" \
-	$(TEX) $< $(AM_V_texidevnull)
-
-%.pdf : %.tex
-	-$(AM_V_PDFTEX)TEXINPUTS="$(srcdir):$(TEXINPUTS):" \
-	$(PDFTEX) $< $(AM_V_texidevnull)
-
-TEX_SRC = \
-  refcard.tex \
-  refcard-a4.tex \
-  refcard-legal.tex \
-  refcard-letter.tex
-
-FORMATTED = \
-  refcard-a4.dvi \
-  refcard-a4.ps \
-  refcard-a4.pdf \
-  refcard-legal.dvi \
-  refcard-legal.ps \
-  refcard-legal.pdf \
-  refcard-letter.dvi \
-  refcard-letter.ps \
-  refcard-letter.pdf
-
-all-local: $(FORMATTED)
-
-refcard-a4.pdf: refcard-a4.tex refcard.tex
-refcard-a4.dvi: refcard-a4.tex refcard.tex
-refcard-a4.ps: refcard-a4.dvi
-	-$(AM_V_DVIPS)$(DVIPS) $(AM_V_texinfo) -T 297mm,210mm -o $@ $<
-
-refcard-legal.pdf: refcard-legal.tex refcard.tex
-refcard-legal.dvi: refcard-legal.tex refcard.tex
-refcard-legal.ps: refcard-legal.dvi
-	-$(AM_V_DVIPS)$(DVIPS) $(AM_V_texinfo) -T 14in,8.5in -o $@ $<
-
-refcard-letter.pdf: refcard-letter.tex refcard.tex
-refcard-letter.dvi: refcard-letter.tex refcard.tex
-refcard-letter.ps: refcard-letter.dvi
-	-$(AM_V_DVIPS)$(DVIPS) $(AM_V_texinfo) -T 11in,8.5in -o $@ $<
-
-EXTRA_DIST = \
-  $(TEX_SRC) \
-  $(FORMATTED)
-
-CLEANFILES = refcard-a4.log refcard-legal.log refcard-letter.log
-
-
-MAINTAINERCLEANFILES = $(FORMATTED)
-
--- a/etc/module.mk	Fri Jul 03 07:51:51 2015 -0400
+++ b/etc/module.mk	Fri Jul 03 19:33:19 2015 -0400
@@ -53,33 +53,36 @@
 
 image_DATA = \
   $(icon_IMAGE_FILES) \
-  octave-logo.ico
+  etc/icons/octave-logo.ico
 
 VENDOR = www.octave.org
 
+DIRSTAMP_FILES += \
+  etc/icons/$(octave_dirstamp)
+
 all-icons: etc/icons/octave.appdata.xml etc/icons/octave.desktop $(BUILT_ICONS)
 
-etc/icons/octave.appdata.xml: etc/iconst/octave.appdata.xml.in Makefile
+etc/icons/octave.appdata.xml: etc/iconst/octave.appdata.xml.in Makefile etc/icons/$(octave_dirstamp)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	$(SED) < $< > $@-t \
 	  -e "s|%OCTAVE_DESKTOP_FILE%|${VENDOR}-octave.desktop|" && \
 	mv $@-t $@
 
-etc/icons/octave.desktop: etc/icons/octave.desktop.in Makefile
+etc/icons/octave.desktop: etc/icons/octave.desktop.in Makefile etc/icons/$(octave_dirstamp)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	$(SED) < $< > $@-t \
 	  -e "s|%OCTAVE_IMAGEDIR%|${imagedir}|" \
 	  -e "s|%OCTAVE_PREFIX%|${prefix}|" && \
 	mv $@-t $@
 
-$(BUILT_PNG_ICONS): etc/icons/octave-logo.svg
+$(BUILT_PNG_ICONS): etc/icons/octave-logo.svg etc/icons/$(octave_dirstamp)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	$(RSVG_CONVERT) -w $(lastword $(subst -, ,$(patsubst %.png,%,$@))) $< > $@-t && \
 	mv $@-t $@
 
-etc/icons/octave-logo.ico: $(WINDOWS_PNG_ICONS)
+etc/icons/octave-logo.ico: $(WINDOWS_PNG_ICONS) etc/icons/$(octave_dirstamp)
 	$(AM_V_GEN)rm -f $@-t $@ && \
-	$(ICOTOOL) --create --raw $^ > $@-t && \
+	$(ICOTOOL) --create --raw  $(WINDOWS_PNG_ICONS) > $@-t && \
 	mv $@-t $@
 
 install-icons:
--- a/examples/module.mk	Fri Jul 03 07:51:51 2015 -0400
+++ b/examples/module.mk	Fri Jul 03 19:33:19 2015 -0400
@@ -4,8 +4,7 @@
 octdata_DATA += \
   $(examples_data_SRC)
 
-EXTRA_DIST += \
-  $(examples_data_SRC) \
+examples_code_SRC = \
   examples/code/@FIRfilter/FIRfilter.m \
   examples/code/@FIRfilter/FIRfilter_aggregation.m \
   examples/code/@FIRfilter/display.m \
@@ -54,5 +53,9 @@
   examples/code/standalonebuiltin.cc \
   examples/code/stringdemo.cc \
   examples/code/structdemo.cc \
-  examples/code/unwinddemo.cc \
+  examples/code/unwinddemo.cc
+
+EXTRA_DIST += \
+  $(examples_data_SRC) \
+  $(examples_code_SRC) \
   examples/module.mk