view doc/module.mk @ 21244:1473547f50f5

include octave-config.h in public header files * mk-opts.pl, mkbuiltins, mk-ops.awk, sparse-mk-ops.awk: Emit "#include octave-config.h" statement for generated header files. * build-env.h, builtins.h, Cell.h, base-text-renderer.h, c-file-ptr-stream.h, cdisplay.h, comment-list.h, data.h, debug.h, defaults.in.h, defun-dld.h, defun-int.h, defun.h, dirfns.h, display.h, dynamic-ld.h, error.h, errwarn.h, event-queue.h, file-io.h, ft-text-renderer.h, gl-render.h, gl2ps-print.h, graphics.in.h, gripes.h, help.h, hook-fcn.h, input.h, jit-ir.h, jit-typeinfo.h, jit-util.h, load-path.h, load-save.h, ls-ascii-helper.h, ls-hdf5.h, ls-mat-ascii.h, ls-mat4.h, ls-mat5.h, ls-oct-binary.h, ls-oct-text.h, ls-utils.h, mex.h, mexproto.h, mxarray.in.h, oct-errno.h, oct-fstrm.h, oct-handle.h, oct-hdf5-types.h, oct-hdf5.h, oct-hist.h, oct-iostrm.h, oct-lvalue.h, oct-map.h, oct-obj.h, oct-opengl.h, oct-prcstrm.h, oct-procbuf.h, oct-stdstrm.h, oct-stream.h, oct-strstrm.h, oct.h, octave-default-image.h, octave-link.h, octave-preserve-stream-state.h, pager.h, pr-output.h, procstream.h, profiler.h, pt-jit.h, sighandlers.h, siglist.h, sparse-xdiv.h, sparse-xpow.h, symtab.h, sysdep.h, text-renderer.h, toplev.h, txt-eng.h, utils.h, variables.h, workspace-element.h, xdiv.h, xnorm.h, xpow.h, zfstream.h, oct-qhull.h, ov-base-diag.h, ov-base-int.h, ov-base-mat.h, ov-base-scalar.h, ov-base-sparse.h, ov-base.h, ov-bool-mat.h, ov-bool-sparse.h, ov-bool.h, ov-builtin.h, ov-cell.h, ov-ch-mat.h, ov-class.h, ov-classdef.h, ov-colon.h, ov-complex.h, ov-cs-list.h, ov-cx-diag.h, ov-cx-mat.h, ov-cx-sparse.h, ov-dld-fcn.h, ov-fcn-handle.h, ov-fcn-inline.h, ov-fcn.h, ov-float.h, ov-flt-complex.h, ov-flt-cx-diag.h, ov-flt-cx-mat.h, ov-flt-re-diag.h, ov-flt-re-mat.h, ov-int-traits.h, ov-int16.h, ov-int32.h, ov-int64.h, ov-int8.h, ov-intx.h, ov-java.h, ov-lazy-idx.h, ov-mex-fcn.h, ov-null-mat.h, ov-oncleanup.h, ov-perm.h, ov-range.h, ov-re-diag.h, ov-re-mat.h, ov-re-sparse.h, ov-scalar.h, ov-str-mat.h, ov-struct.h, ov-type-conv.h, ov-typeinfo.h, ov-uint16.h, ov-uint32.h, ov-uint64.h, ov-uint8.h, ov-usr-fcn.h, ov.h, ovl.h, octave.h, op-int.h, ops.h, options-usage.h, lex.h, parse.h, pt-all.h, pt-arg-list.h, pt-array-list.h, pt-assign.h, pt-binop.h, pt-bp.h, pt-cbinop.h, pt-cell.h, pt-check.h, pt-classdef.h, pt-cmd.h, pt-colon.h, pt-const.h, pt-decl.h, pt-eval.h, pt-except.h, pt-exp.h, pt-fcn-handle.h, pt-funcall.h, pt-id.h, pt-idx.h, pt-jump.h, pt-loop.h, pt-mat.h, pt-misc.h, pt-pr-code.h, pt-select.h, pt-stmt.h, pt-unop.h, pt-walk.h, pt.h, token.h, version.in.h, Array-util.h, Array.h, CColVector.h, CDiagMatrix.h, CMatrix.h, CNDArray.h, CRowVector.h, CSparse.h, DiagArray2.h, MArray.h, MDiagArray2.h, MSparse.h, Matrix.h, MatrixType.h, PermMatrix.h, Range.h, Sparse.h, boolMatrix.h, boolNDArray.h, boolSparse.h, chMatrix.h, chNDArray.h, dColVector.h, dDiagMatrix.h, dMatrix.h, dNDArray.h, dRowVector.h, dSparse.h, dim-vector.h, fCColVector.h, fCDiagMatrix.h, fCMatrix.h, fCNDArray.h, fCRowVector.h, fColVector.h, fDiagMatrix.h, fMatrix.h, fNDArray.h, fRowVector.h, idx-vector.h, int16NDArray.h, int32NDArray.h, int64NDArray.h, int8NDArray.h, intNDArray.h, uint16NDArray.h, uint32NDArray.h, uint64NDArray.h, uint8NDArray.h, f77-fcn.h, lo-error.h, quit.h, CmplxAEPBAL.h, CmplxCHOL.h, CmplxGEPBAL.h, CmplxHESS.h, CmplxLU.h, CmplxQR.h, CmplxQRP.h, CmplxSCHUR.h, CmplxSVD.h, CollocWt.h, DAE.h, DAEFunc.h, DAERT.h, DAERTFunc.h, DASPK.h, DASRT.h, DASSL.h, DET.h, EIG.h, LSODE.h, ODE.h, ODEFunc.h, ODES.h, ODESFunc.h, Quad.h, base-aepbal.h, base-dae.h, base-de.h, base-lu.h, base-min.h, base-qr.h, bsxfun-decl.h, bsxfun.h, dbleAEPBAL.h, dbleCHOL.h, dbleGEPBAL.h, dbleHESS.h, dbleLU.h, dbleQR.h, dbleQRP.h, dbleSCHUR.h, dbleSVD.h, eigs-base.h, fCmplxAEPBAL.h, fCmplxCHOL.h, fCmplxGEPBAL.h, fCmplxHESS.h, fCmplxLU.h, fCmplxQR.h, fCmplxQRP.h, fCmplxSCHUR.h, fCmplxSVD.h, fEIG.h, floatAEPBAL.h, floatCHOL.h, floatGEPBAL.h, floatHESS.h, floatLU.h, floatQR.h, floatQRP.h, floatSCHUR.h, floatSVD.h, lo-mappers.h, lo-specfun.h, oct-convn.h, oct-fftw.h, oct-norm.h, oct-rand.h, oct-spparms.h, randgamma.h, randmtzig.h, randpoisson.h, sparse-chol.h, sparse-dmsolve.h, sparse-lu.h, sparse-qr.h, Sparse-diag-op-defs.h, Sparse-op-decls.h, Sparse-op-defs.h, Sparse-perm-op-defs.h, mx-base.h, mx-defs.h, mx-ext.h, mx-op-decl.h, mx-op-defs.h, dir-ops.h, file-ops.h, file-stat.h, lo-sysdep.h, mach-info.h, oct-env.h, oct-group.h, oct-openmp.h, oct-passwd.h, oct-syscalls.h, oct-time.h, oct-uname.h, pathlen.h, sysdir.h, syswait.h, action-container.h, base-list.h, byte-swap.h, caseless-str.h, cmd-edit.h, cmd-hist.h, data-conv.h, functor.h, glob-match.h, lo-array-errwarn.h, lo-array-gripes.h, lo-cutils.h, lo-ieee.h, lo-macros.h, lo-math.h, lo-regexp.h, lo-traits.h, lo-utils.h, oct-alloc.h, oct-base64.h, oct-binmap.h, oct-cmplx.h, oct-glob.h, oct-inttypes.h, oct-locbuf.h, oct-mutex.h, oct-refcount.h, oct-rl-edit.h, oct-rl-hist.h, oct-shlib.h, oct-sort.h, oct-sparse.h, pathsearch.h, singleton-cleanup.h, sparse-sort.h, sparse-util.h, statdefs.h, str-vec.h, sun-utils.h, unwind-prot.h, url-transfer.h: Include octave-config.h.
author John W. Eaton <jwe@octave.org>
date Wed, 10 Feb 2016 14:25:53 -0500
parents 7eca4ba9bb6d
children b76955e83fe4
line wrap: on
line source

doc_EXTRA_DIST =

doc_CLEANFILES =
doc_DISTCLEANFILES =
doc_MAINTAINERCLEANFILES =

TEXINPUTS := $(PATH_SEPARATOR)$(abs_top_srcdir)/doc/interpreter$(PATH_SEPARATOR)$(PATH_SEPARATOR)$(abs_top_builddir)/doc/interpreter$(PATH_SEPARATOR)$(abs_top_builddir)/doc/.texmf-var//$(PATH_SEPARATOR)$(TEXINPUTS)$(PATH_SEPARATOR)

TEXMFCNF := $(PATH_SEPARATOR)$(abs_top_srcdir)/doc$(PATH_SEPARATOR)$(abs_top_builddir)/doc$(PATH_SEPARATOR)$(TEXMFCNF)$(PATH_SEPARATOR)

TEXMFVAR := $(abs_top_builddir)/doc/.texmf-var

export TEXINPUTS
export TEXMFCNF
export TEXMFVAR

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 =

## Conditionally define the following variables so that --disable-docs
## can work.  If we don't define them, Automake will always define them,
## even when AMCOND_BUILD_DOCS is false.

INFO_DEPS =
DVIS =
PDFS =
PSS =
HTMLS =

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_EXTRA_DIST += doc/texmf.cnf

doc_EXTRA_DIST += \
  doc/doxyhtml/Doxyfile.in \
  doc/doxyhtml/README

doxyhtml: | doc/doxyhtml/$(octave_dirstamp)
	doxygen doc/doxyhtml/Doxyfile

doxyhtml-maintainer-clean:
	rm -f doc/doxygen_sqlite3.db
	cd doc/doxyhtml && \
	rm -rf `ls | $(GREP) -v Doxyfile.in | $(GREP) -v README`

DIRSTAMP_FILES += doc/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 \
  doc/interpreter/plot-uimenuproperties.texi \
  doc/interpreter/plot-uicontextmenuproperties.texi \
  doc/interpreter/plot-uipanelproperties.texi \
  doc/interpreter/plot-uicontrolproperties.texi \
  doc/interpreter/plot-uitoolbarproperties.texi \
  doc/interpreter/plot-uipushtoolproperties.texi \
  doc/interpreter/plot-uitoggletoolproperties.texi

$(GRAPH_PROP_TEXI_SRC): | $(OCTAVE_INTERPRETER_TARGETS)

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)

doc/interpreter/plot-uimenuproperties.texi: doc/interpreter/genpropdoc.m
	$(AM_V_GEN)$(call gen-propdoc-texi,uimenu)

doc/interpreter/plot-uicontextmenuproperties.texi: doc/interpreter/genpropdoc.m
	$(AM_V_GEN)$(call gen-propdoc-texi,uicontextmenu)

doc/interpreter/plot-uipanelproperties.texi: doc/interpreter/genpropdoc.m
	$(AM_V_GEN)$(call gen-propdoc-texi,uipanel)

doc/interpreter/plot-uicontrolproperties.texi: doc/interpreter/genpropdoc.m
	$(AM_V_GEN)$(call gen-propdoc-texi,uicontrol)

doc/interpreter/plot-uitoolbarproperties.texi: doc/interpreter/genpropdoc.m
	$(AM_V_GEN)$(call gen-propdoc-texi,uitoolbar)

doc/interpreter/plot-uipushtoolproperties.texi: doc/interpreter/genpropdoc.m
	$(AM_V_GEN)$(call gen-propdoc-texi,uipushtool)

doc/interpreter/plot-uitoggletoolproperties.texi: doc/interpreter/genpropdoc.m
	$(AM_V_GEN)$(call gen-propdoc-texi,uitoggletool)

dist_man_MANS = \
  doc/interpreter/mkoctfile.1 \
  doc/interpreter/octave-cli.1 \
  doc/interpreter/octave-config.1 \
  doc/interpreter/octave.1

DOC_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_DOC_IMAGES += \
  $(BUILT_DOC_IMAGES_EPS) \
  $(BUILT_DOC_IMAGES_PDF) \
  $(BUILT_DOC_IMAGES_PNG) \
  $(BUILT_DOC_IMAGES_TXT)

DOC_IMAGES_EPS += $(BUILT_DOC_IMAGES_EPS)
DOC_IMAGES_PDF += $(BUILT_DOC_IMAGES_PDF)
DOC_IMAGES_PNG += $(BUILT_DOC_IMAGES_PNG)
DOC_IMAGES_TXT += $(BUILT_DOC_IMAGES_TXT)

DOC_IMAGES += \
  $(BUILT_DOC_IMAGES) \
  $(DOC_JAVA_IMAGES)

$(BUILT_DOC_IMAGES): | $(OCTAVE_INTERPRETER_TARGETS)

## FIXME: DOC_JAVA_IMAGES will eventually need to be added to the HTML build.
##        It will require a different Makefile rule later because
##        DOC_JAVA_IMAGES live in a subdir rather than in the current directory.

HTMLDIR_IMAGES = $(patsubst doc/interpreter/%.png, doc/interpreter/octave.html/%.png, $(DOC_IMAGES_PNG))

LOGOS = \
  doc/interpreter/octave_logo.eps \
  doc/interpreter/octave_logo.pdf

DOC_IMAGES_EPS += doc/interpreter/octave_logo.eps
DOC_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

octave_TEXINFOS = \
  $(BUILT_OCTAVE_TEXI_SRC)

INFO_DEPS += $(srcdir)/doc/interpreter/octave.info
DVIS += doc/interpreter/octave.dvi
PDFS += doc/interpreter/octave.pdf
PSS += doc/interpreter/octave.ps
HTMLS += doc/interpreter/octave.html

## 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.

OCTAVE_HTML_DIR = doc/interpreter/octave.html
OCTAVE_HTML_TMP_DIR = $(OCTAVE_HTML_DIR:.html=.htp)
OCTAVE_HTML_STAMP = $(OCTAVE_HTML_DIR)/.octave-html-stamp

OCTAVE_CSS = doc/interpreter/octave.css
HTMLDIR_CSS = $(OCTAVE_HTML_DIR)/octave.css

$(srcdir)/doc/interpreter/octave.info: $(DOC_IMAGES_TXT) $(octave_TEXINFOS)
doc/interpreter/octave.dvi: $(DOC_IMAGES_EPS) $(octave_TEXINFOS)
doc/interpreter/octave.pdf: $(DOC_IMAGES_PDF) $(octave_TEXINFOS)
$(OCTAVE_HTML_STAMP): $(DOC_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 $(abs_top_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 $(abs_top_srcdir)/doc/interpreter' \
	$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
	`test -f 'doc/interpreter/octave.texi' || echo '$(abs_top_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 $(abs_top_srcdir)/doc/interpreter' \
	$(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
	`test -f 'doc/interpreter/octave.texi' || echo '$(abs_top_srcdir)/'`doc/interpreter/octave.texi

doc/interpreter/octave.html: $(OCTAVE_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 $(abs_top_srcdir)/doc/interpreter \
	 --css-ref=octave.css \
	 -o $(OCTAVE_HTML_TMP_DIR) `test -f 'doc/interpreter/octave.texi' || echo '$(abs_top_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) $(HTMLDIR_CSS) : doc/interpreter/octave.html/%: doc/interpreter/% $(OCTAVE_HTML_STAMP)
	$(AM_V_GEN)cp $< $@

DOC_TARGETS += \
  $(srcdir)/doc/interpreter/octave.info \
  doc/interpreter/doc-cache \
  doc/interpreter/octave.ps \
  doc/interpreter/octave.pdf \
  $(OCTAVE_HTML_STAMP) \
  $(HTMLDIR_IMAGES) \
  $(HTMLDIR_CSS)

doc_EXTRA_DIST += \
  $(BUILT_OCTAVE_TEXI_SRC) \
  $(srcdir)/doc/interpreter/octave.info \
  doc/interpreter/TODO \
  doc/interpreter/doc-cache \
  doc/interpreter/octave.dvi \
  doc/interpreter/octave.ps \
  doc/interpreter/octave.pdf \
  doc/interpreter/octave.html \
  $(HTMLDIR_IMAGES) \
  $(OCTAVE_CSS)

# 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

doc/interpreter/doc-cache: $(DOCSTRING_FILES) doc/interpreter/mk_doc_cache.m | $(OCTAVE_INTERPRETER_TARGETS) 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)

## These two texi files have an additional dependency through the
## @EXAMPLEFILE macro.
doc/interpreter/oop.texi: $(examples_code_SRC)
doc/interpreter/external.texi: $(examples_code_SRC)

%.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 $@-t $< && \
	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 $@-t $< && \
	mv $@-t $@

doc_EXTRA_DIST += \
  doc/interpreter/config-images.sh \
  doc/interpreter/contributors.in \
  doc/interpreter/doc-cache \
  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 \
  $(DOC_IMAGES) \
  $(DOC_IMAGES_SRC) \
  $(LOGOS) \
  $(TXI_SRC)

doc_DISTCLEANFILES += \
  $(OCTAVE_HTML_STAMP)

doc_MAINTAINERCLEANFILES += \
  AUTHORS \
  $(BUILT_DOC_IMAGES) \
  $(BUILT_OCTAVE_TEXI_SRC) \
  doc/interpreter/doc-cache

## The TeX software suite is used to create both PDF and PS output formats.
## In order to avoid race conditions between simultaneous TeX commands, the
## PDF and PS builds are forced to run serially through the following rule.
doc/interpreter/octave.pdf: doc/interpreter/octave.ps

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

INFO_DEPS += $(srcdir)/doc/liboctave/liboctave.info
DVIS += doc/liboctave/liboctave.dvi
PDFS += doc/liboctave/liboctave.pdf
PSS += doc/liboctave/liboctave.ps
HTMLS += doc/liboctave/liboctave.html

doc/liboctave/liboctave.dvi: doc/liboctave/liboctave.texi $(srcdir)/doc/liboctave/version-liboctave.texi | doc/liboctave/$(am__dirstamp)
	$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc/liboctave -I $(srcdir)/doc/liboctave' \
	$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
	`test -f 'doc/liboctave/liboctave.texi' || echo '$(srcdir)/'`doc/liboctave/liboctave.texi

doc/liboctave/liboctave.pdf: doc/liboctave/liboctave.texi $(srcdir)/doc/liboctave/version-liboctave.texi | doc/liboctave/$(am__dirstamp)
	$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc/liboctave -I $(srcdir)/doc/liboctave' \
	$(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
	`test -f 'doc/liboctave/liboctave.texi' || echo '$(srcdir)/'`doc/liboctave/liboctave.texi

doc/liboctave/liboctave.html: doc/liboctave/liboctave.texi $(srcdir)/doc/liboctave/version-liboctave.texi | doc/liboctave/$(am__dirstamp)
	$(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
	$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc/liboctave -I $(srcdir)/doc/liboctave \
	 -o $(@:.html=.htp) `test -f 'doc/liboctave/liboctave.texi' || echo '$(srcdir)/'`doc/liboctave/liboctave.texi; \
	then \
	  rm -rf $@ && mv $(@:.html=.htp) $@; \
	else \
	  rm -rf $(@:.html=.htp); exit 1; \
	fi

DOC_TARGETS += \
  $(srcdir)/doc/liboctave/liboctave.info \
  doc/liboctave/liboctave.ps \
  doc/liboctave/liboctave.pdf \
  doc/liboctave/liboctave.html

doc_EXTRA_DIST += \
  $(liboctave_TEXINFOS) \
  $(srcdir)/doc/liboctave/liboctave.info \
  doc/liboctave/liboctave.dvi \
  doc/liboctave/liboctave.ps \
  doc/liboctave/liboctave.pdf \
  doc/liboctave/liboctave.html

## The TeX software suite is used to create both PDF and PS output formats.
## In order to avoid race conditions between simultaneous TeX commands, the
## PDF and PS builds are forced to run serially through the following rule.
doc/liboctave/liboctave.pdf: doc/liboctave/liboctave.ps

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 $@ $<

DIRSTAMP_FILES += doc/refcard/$(octave_dirstamp)

$(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="$(abs_top_srcdir)/doc/refcard:$(TEXINPUTS):" \
	$(TEX) $(<F) $(AM_V_texidevnull)

$(refcard_PDF) : %.pdf : %.tex | doc/refcard/$(octave_dirstamp)
	-$(AM_V_PDFTEX)cd $(@D) && \
	TEXINPUTS="$(abs_top_srcdir)/doc/refcard:$(TEXINPUTS):" \
	$(PDFTEX) $(<F) $(AM_V_texidevnull)

doc_EXTRA_DIST += \
  $(refcard_FORMATTED) \
  $(refcard_TEX_SRC)

doc_CLEANFILES += \
  doc/refcard/refcard-a4.log \
  doc/refcard/refcard-legal.log \
  doc/refcard/refcard-letter.log

doc_MAINTAINERCLEANFILES += \
  $(refcard_FORMATTED)

endif

doc/interpreter/undocumented_list:
	rm -f $@-t $@
	-cd $(srcdir)/doc/interpreter; $(PERL) ./doccheck/mk_undocumented_list > $(@F)-t
	mv $@-t $@
.PHONY: doc/interpreter/undocumented_list

SPELLCHECK_FILES = $(MUNGED_TEXI_SRC:.texi=.scheck)

%.scheck: %.texi | doc/interpreter/$(octave_dirstamp)
	cd $(srcdir)/doc/interpreter; ./doccheck/spellcheck $(<F) > $(@F)-t
	mv $@-t $@
	[ -s $@ ] || rm -f $@

spellcheck: $(SPELLCHECK_FILES)
	@cd $(srcdir)/doc/interpreter ; \
	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 += $(doc_EXTRA_DIST)

CLEANFILES += $(doc_CLEANFILES)
DISTCLEANFILES += $(doc_DISTCLEANFILES)
MAINTAINERCLEANFILES += $(doc_MAINTAINERCLEANFILES)

doc-clean:
	rm -f $(doc_CLEANFILES)
	rm -rf doc/interpreter/octave.t2d
	rm -rf doc/interpreter/octave.t2p
	rm -rf doc/liboctave/liboctave.t2d
	rm -rf doc/liboctave/liboctave.t2p
	rm -rf doc/.texmf-var


doc-distclean: doc-clean
	rm -f $(doc_DISTCLEANFILES)

doc-maintainer-clean: doc-distclean
	rm -f $(doc_MAINTAINERCLEANFILES)