## @configure_input@
##
## @file    Makefile
## @brief   Create the API reference manuals and other documentation.
## @author  Michael Hucka (Caltech)
##
## This file is part of libSBML.  Please visit http://sbml.org for more
## information about SBML, and the latest version of libSBML.
##
## Copyright (C) 2013-2016 jointly by the following organizations:
##     1. California Institute of Technology, Pasadena, CA, USA
##     2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
##     3. University of Heidelberg, Heidelberg, Germany
##
## Copyright (C) 2009-2013 jointly by the following organizations:
##     1. California Institute of Technology, Pasadena, CA, USA
##     2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
##
## Copyright (C) 2006-2008 by the California Institute of Technology,
##     Pasadena, CA, USA
##
## Copyright (C) 2002-2005 jointly by the following organizations:
##     1. California Institute of Technology, Pasadena, CA, USA
##     2. Japan Science and Technology Agency, Japan
##
## This library is free software; you can redistribute it and/or modify it
## under the terms of the GNU Lesser General Public License as published by
## the Free Software Foundation.  A copy of the license agreement is provided
## in the file named "LICENSE.txt" included with this software distribution
## and also available online as http://sbml.org/software/libsbml/license.html
##


# -----------------------------------------------------------------------------
# Configuration variables
# -----------------------------------------------------------------------------
# Some of the following are substituted automatically by `configure'.  If
# you are looking at "Makefile", do not edit these values; instead, run the
# configure script at the top level of the src tree.  It will recreate
# "Makefile".

include @top_srcdir@/config/makefile-common-vars.mk

# `srcdir' points to the current directory, but should be set by configure.
# `subdir' must be set manually to the relative dir under srcdir.  Don't
# set `subdir' to an absolute path, or some `make' actions will fail.

srcdir  = @srcdir@
thisdir = docs/src

# We currently only generate documentation in HTML format.

# In order to be able to create distributions with ready-to-read docs, we
# have a separate directory for formatted docs.

formatted     = ../formatted

cpp-manual    = $(formatted)/cpp-api
c-manual      = $(formatted)/c-api
csharp-manual = $(formatted)/csharp-api
java-manual   = $(formatted)/java-api
python-manual = $(formatted)/python-api
perl-manual   = $(formatted)/perl-api
matlab-manual = $(formatted)/matlab-api
octave-manual = $(formatted)/octave-api

# If libSBML has been configured with doxygen support, then the C++ and C
# manuals are always made, and additional manuals depend on the options
# with which libSBML was configured.  If libSBML has not been configured
# with doxygen support, then only the Java manual can be made (since doing
# so doesn't require doxygen).

ifneq "$(USE_DOXYGEN)" ""
  docs = $(cpp-manual)  # $(c-manual) Skip C because it's so out of date.
else
  docs =
endif

ifdef USE_JAVA
  docs += $(java-manual)
endif
ifdef USE_PYTHON
  docs += $(python-manual)
endif
# Currently, the Perl docs aren't ready.  So let's not make them.
# ifdef USE_PERL
#   docs += $(perl-manual)
# endif
ifdef USE_CSHARP
  docs += $(csharp-manual)
endif
ifdef USE_MATLAB
  docs += $(matlab-manual)
endif
ifdef USE_OCTAVE
  docs += $(octave-manual)
endif

# The variable `extra_clean' is used in `makefile-common-actions.mk'
# for `make dist'.  Normally you wouldn't want to remove documentation
# files, but the following are all generated files and directories.

extra_clean =                        \
        *.class                      \
        class-list.txt               \
        doxygen-config.txt           \
        doxygen-version-specific.txt \
        java-files                   \
        libsbml.pc                   \
        libsbml.py

# We don't want to remove the formatted docs during a regular make clean,
# only a distclean.

extra_distclean =                           \
        Makefile                            \
        $(docs)                             \
        common-text/libsbml-version.html    \
        doxygen-config-c.txt                \
        doxygen-config-cpp.txt              \
        doxygen-config-csharp.txt           \
        doxygen-config-matlab.txt           \
        doxygen-config-octave.txt           \
        doxygen-config-perl.txt             \
        doxygen-config-python.txt           \
        perlmod                             \
        xml                                 \
        $(other-generated-files)            \
        $(expanded-html-files)

# The `make dist' rules for this directory are more complicated than usual.
# There are additional separate rules below.

distfiles =                                                  \
        SBMLDoclet.java                                      \
        Makefile.in                                          \
        common-graphics/biology-qualifiers.png               \
        common-graphics/biology-qualifiers.txt               \
        common-graphics/cmake-build-dir-dialog.png           \
        common-graphics/cmake-configure-macos.png            \
        common-graphics/cmake-configure-windows.png          \
        common-graphics/cmake-empty-screenshot.png           \
        common-graphics/cmake-empty-windows.png              \
        common-graphics/cmake-options-red-windows.png        \
        common-graphics/cmake-options-red.png                \
        common-graphics/comp-examples.graffle                \
        common-graphics/comp-examples.svg                    \
        common-graphics/enzyme-reaction-equation.graffle     \
        common-graphics/enzyme-reaction-equation.svg         \
        common-graphics/ftv2doc.png                          \
        common-graphics/ftv2folderclosed.png                 \
        common-graphics/ftv2folderopen.png                   \
        common-graphics/hellojsp-screenshot.png              \
        common-graphics/icon-format-pdf-44px.jpg             \
        common-graphics/icon-format-html-44px.jpg            \
        common-graphics/layout-example.png                   \
        common-graphics/listof-illustration.svg              \
        common-graphics/model-qualifiers.png                 \
        common-graphics/model-qualifiers.txt                 \
        common-graphics/obs-download-python-libsbml.png      \
        common-graphics/official-sbml-supported-32.jpg       \
        common-graphics/official-sbml-supported-40.jpg       \
        common-graphics/official-sbml-supported-70.png       \
        common-graphics/right-arrow.gif                      \
        common-graphics/right-arrow-2x.png                   \
        common-graphics/simple-ast.graffle                   \
        common-graphics/simple-ast.svg                       \
        common-graphics/solution-explorer-windows.png        \
        common-graphics/sourceforge-download.png             \
        common-graphics/sourceforge-download-windows.png     \
        common-graphics/tab_a.png                            \
        common-graphics/tab_b.png                            \
        common-graphics/tab_h.png                            \
        common-graphics/tab_s.png                            \
        common-text/about-sbml-units-attrib.html             \
        common-text/about-semantic-annotations.html          \
        common-text/assuming-compressed-file.html            \
        common-text/astnode-illustration.html                \
        common-text/astnode-types.html                       \
        common-text/comment-set-methods.html                 \
        common-text/doxygen-regular-text-end.html            \
        common-text/doxygen-regular-text-start.html          \
        common-text/doxygen-small-text-end.html              \
        common-text/doxygen-small-text-start.html            \
        common-text/enzymatic-reaction-equation.html         \
        common-text/example-sbml-enzyme-model.html           \
        common-text/example-sbml-enzyme-model.xml            \
        common-text/example-sbml-flattened-output.html       \
        common-text/example-sbml-flattened-output.xml        \
        common-text/example-sbml-main.html                   \
        common-text/example-sbml-main.xml                    \
        common-text/force-serif-font-off.html                \
        common-text/force-serif-font-on.html                 \
        common-text/level-1-uses-text-string-math.html       \
        common-text/libsbml-authors.html                     \
        common-text/libsbml-blurb.html                       \
        common-text/libsbml-coding-copydetails-example.html  \
        common-text/libsbml-coding-copydoc-example.html      \
        common-text/libsbml-coding-enum-text-example.html    \
        common-text/libsbml-coding-link-example.html         \
        common-text/libsbml-communications.html              \
        common-text/libsbml-downloading.html.in              \
        common-text/libsbml-doxygen.html                     \
        common-text/libsbml-facility-only-warning.html       \
        common-text/libsbml-features.html                    \
        common-text/libsbml-group-comp-intro.html.in         \
        common-text/libsbml-group-core-intro.html            \
        common-text/libsbml-group-fbc-intro.html.in          \
        common-text/libsbml-group-groups-intro.html.in        \
        common-text/libsbml-group-layout-intro.html.in       \
        common-text/libsbml-group-qual-intro.html.in         \
        common-text/libsbml-import-for-c-cpp.html	     \
        common-text/libsbml-import-for-csharp.html	     \
        common-text/libsbml-import-for-java.html	     \
        common-text/libsbml-import-for-javascript.html	     \
        common-text/libsbml-import-for-matlab.html	     \
        common-text/libsbml-import-for-python.html	     \
        common-text/libsbml-import-for-r.html		     \
        common-text/libsbml-installation.html.in             \
        common-text/libsbml-issues.html                      \
        common-text/libsbml-papers.html                      \
	common-text/libsbml-setting-library-path.html        \
        common-text/libsbml-version.html.in                  \
        common-text/listof-illustration.html                 \
        common-text/listof-illustration.txt                  \
        common-text/math-functions.html                      \
        common-text/math-precedence-table-l3.html            \
        common-text/math-precedence-table.html               \
        common-text/not-sbml-warning.html                    \
        common-text/note-reading-zipped-files.html           \
        common-text/note-writing-zipped-files.html           \
        common-text/parameter-addition-overrides-values.html \
        common-text/pkg-marker-comp.html                     \
        common-text/pkg-marker-comp.txt                      \
        common-text/pkg-marker-core.html                     \
        common-text/pkg-marker-core.txt                      \
        common-text/pkg-marker-fbc.html                      \
        common-text/pkg-marker-fbc.txt                       \
        common-text/pkg-marker-groups.html                    \
        common-text/pkg-marker-groups.txt                     \
        common-text/pkg-marker-layout.html                   \
        common-text/pkg-marker-layout.txt                    \
        common-text/pkg-marker-qual.html                     \
        common-text/pkg-marker-qual.txt                      \
        common-text/plain-font-off.html                      \
        common-text/plain-font-on.html                       \
        common-text/predefined-units.html                    \
        common-text/sbml-specifications-table.html.in        \
        common-text/species-boundarycondition.html           \
        common-text/species-hasonlysubstance.html            \
        common-text/string-functions-table-l3.html           \
        common-text/string-functions-table.html              \
        common-text/string-values-table-l3.html              \
        common-text/unitid-syntax.html                       \
        common-text/unitkind-table.html                      \
        common-text/unitkind-table.txt                       \
        common-text/warn-default-args-in-docs.html           \
        common-text/xmlid-syntax.html                        \
        css/libsbml-base-stylesheet.css                      \
        css/libsbml-c-stylesheet.css                         \
        css/libsbml-doxygen-navtree.css                      \
        css/libsbml-doxygen-stylesheet.css                   \
        css/libsbml-doxygen-tabs.css                         \
        css/libsbml-javadoc-stylesheet.css                   \
        css/libsbml-python-stylesheet.css                    \
        css/libsbml-reset-stylesheet.css                     \
        css/search.css                                       \
        css/search.png                                       \
        doxygen-config-c.txt.cmake                           \
        doxygen-config-c.txt.in                              \
        doxygen-config-common.txt                            \
        doxygen-config-common.txt.cmake                      \
        doxygen-config-cpp.txt.cmake                         \
        doxygen-config-cpp.txt.in                            \
        doxygen-config-csharp.txt.in                         \
        doxygen-config-csharp.txt.cmake                      \
        doxygen-config-matlab.txt.in                         \
        doxygen-config-octave.txt.in                         \
        doxygen-config-perl.txt.cmake                        \
        doxygen-config-perl.txt.in                           \
        doxygen-config-python.txt.cmake                      \
        doxygen-config-python.txt.in                         \
        doxygen-footer.html                                  \
        doxygen-header.html                                  \
        doxygen-layout-c.xml                                 \
        doxygen-layout-cpp.xml                               \
        doxygen-layout-csharp.xml                            \
        doxygen-layout-notcpp.xml                            \
        doxygen-layout-python.xml                            \
        filters/doc-filter-c.py                              \
        filters/doc-filter-csharp.py                         \
        filters/doc-filter-python.py                         \
        java-substitutions/ASTNodeList.java                  \
        java-substitutions/CompPkgNamespaces.java            \
        java-substitutions/CVTermList.java                   \
        java-substitutions/DateList.java                     \
        java-substitutions/FbcPkgNamespaces.java             \
        java-substitutions/GroupsPkgNamespaces.java          \
        java-substitutions/LayoutPkgNamespaces.java          \
        java-substitutions/ModelCreatorList.java             \
        java-substitutions/QualPkgNamespaces.java            \
        java-substitutions/SBMLConstructorException.java     \
        java-substitutions/SBMLNamespacesList.java           \
        java-substitutions/SBaseList.java                    \
        java-substitutions/XMLConstructorException.java      \
        java-substitutions/libsbmlConstants.java.in          \
        libsbml-accessing.txt                                \
        libsbml-api-guide.txt                                \
        libsbml-basics-of-extensions.txt                     \
        libsbml-coding.txt                                   \
        libsbml-communications.txt                           \
        libsbml-csharp-example-files.txt                     \
        libsbml-csharp-math.txt                              \
        libsbml-csharp-reading-files.txt                     \
        libsbml-downloading.txt                              \
        libsbml-example-c.txt                                \
        libsbml-example-files-c.txt                          \
        libsbml-example-files.txt                            \
        libsbml-example.txt                                  \
        libsbml-extending.txt                                \
        libsbml-extension-support-classes.txt                \
        libsbml-features.txt                                 \
        libsbml-groups.txt                                   \
        libsbml-help.txt                                     \
        libsbml-howto-implement-extension.txt                \
        libsbml-installation-guide.txt                       \
        libsbml-installation.txt                             \
        libsbml-issues.txt                                   \
        libsbml-java-bottom.html                             \
        libsbml-java-example-bottom.html                     \
        libsbml-java-example-files.html                      \
        libsbml-java-example-footer.html                     \
        libsbml-java-example-top.html                        \
        libsbml-java-fake-overview.html                      \
        libsbml-java-footer.html                             \
        libsbml-java-installation-guide.html                 \
        libsbml-java-math.html                               \
        libsbml-java-misc.html                               \
        libsbml-java-overview.html                           \
        libsbml-java-reading.html                            \
        libsbml-java-top.html                                \
        libsbml-java-verb-bottom.html                        \
        libsbml-java-verb-top.html                           \
        libsbml-license.txt                                  \
        libsbml-mainpage.txt                                 \
        libsbml-math.txt                                     \
        libsbml-matlab-reading-files.txt                     \
        libsbml-news.txt                                     \
        libsbml-octave-reading-files.txt                     \
        libsbml-other.txt                                    \
        libsbml-programming.txt                              \
        libsbml-python-creating-model.txt                    \
        libsbml-python-example-files.txt                     \
        libsbml-python-reading-files.txt                     \
        libsbml-reading-files.txt                            \
        libsbml-release-info.txt                             \
        libsbml-sbml-specifications.txt                      \
        python-substitutions/ASTNodeList.py                  \
        python-substitutions/SBaseList.py                    \
        python-substitutions/CVTermList.py                   \
        python-substitutions/CompPkgNamespaces.py            \
        python-substitutions/DateList.py                     \
        python-substitutions/FbcPkgNamespaces.py             \
        python-substitutions/GroupsPkgNamespaces.py          \
        python-substitutions/LayoutPkgNamespaces.py          \
        python-substitutions/ModelCreatorList.py             \
        python-substitutions/QualPkgNamespaces.py            \
        python-substitutions/SBMLNamespacesList.py           \
        python-substitutions/libsbml.py                      \
        python-substitutions/ostream.py                      \
        python-substitutions/ostringstream.py                \
        sbml.js                                              \
        utilities/compare-classes.py                         \
        utilities/compare-constants.py                       \
        utilities/generate-class-name-list.py                \
        utilities/generate-converters-list.py                \
        utilities/generate-cplusplus-class-names.py          \
        utilities/generate-extensions-summary.py             \
        utilities/generate-pkg-stylesheet.py                 \
        utilities/prettify/README.txt                        \
        utilities/prettify/prettify.css                      \
        utilities/prettify/prettify.js                       \
        utilities/pythondocpreprocessor.py

# Additional odds and ends.

logo-files = common-graphics/official-sbml-supported-32.jpg \
             common-graphics/official-sbml-supported-40.jpg \
             common-graphics/official-sbml-supported-70.png

# Error msg used below.  Do not put a period on the last sentence because
# one will be added automatically.

define nodoxygen

  Cannot create manuals, either because libSBML was not
  configured using --with-doxygen, or 'doxygen' cannot be found, or
  the version of 'doxygen' found is too old.  Please reconfigure with
  a suitable value for the configuration flag --with-doxygen
endef


# -----------------------------------------------------------------------------
# Primary build actions
# -----------------------------------------------------------------------------

# The default rules in `makefile-common-actions.mk' know to interpret goals
# of the form `foo-recursive' to run 'make foo' in directories defined in
# variable `subdirs'.

ifeq "$(USE_DOXYGEN)" ""
  ifdef USE_JAVA
    all docs: Makefile $(docs)
  else
    all docs:; $(error $(nodoxygen))
  endif
else
  all docs: Makefile $(docs)
endif


# -----------------------------------------------------------------------------
# Checking.
# -----------------------------------------------------------------------------

ifdef USE_LIBCHECK
  check: all run-checks
else
  check:
	$(error "Please first rerun 'configure' with the --with-check flag")
endif


# -----------------------------------------------------------------------------
# API reference manuals.
# -----------------------------------------------------------------------------

#
# Rules for remaking the C++, C, Python and Perl manuals.
#
# These require configuring libSBML with --with-doxygen *and* a
# sufficiently recent version of doxygen.  The version check is done by
# configure.
#

doxygen-cpp-conf    = doxygen-config-cpp.txt.in doxygen-config-common.txt
doxygen-c-conf      = doxygen-config-c.txt.in doxygen-config-common.txt
doxygen-csharp-conf = doxygen-config-csharp.txt.in doxygen-config-common.txt
doxygen-py-conf     = doxygen-config-python.txt.in doxygen-config-common.txt
doxygen-perl-conf   = doxygen-config-perl.txt.in doxygen-config-common.txt
doxygen-matlab-conf = doxygen-config-matlab.txt.in doxygen-config-common.txt
doxygen-octave-conf = doxygen-config-octave.txt.in doxygen-config-common.txt

doxygen-config-cpp.txt:  $(doxygen-cpp-conf) $(TOP_SRCDIR)/VERSION.txt
	cd $(TOP_BUILDDIR) && $(SHELL) ./config.status $(thisdir)/$@

doxygen-config-c.txt:  $(doxygen-c-conf) $(TOP_SRCDIR)/VERSION.txt
	cd $(TOP_BUILDDIR) && $(SHELL) ./config.status $(thisdir)/$@

doxygen-config-csharp.txt:  $(doxygen-csharp-conf) $(TOP_SRCDIR)/VERSION.txt
	cd $(TOP_BUILDDIR) && $(SHELL) ./config.status $(thisdir)/$@

doxygen-config-python.txt:  $(doxygen-py-conf) $(TOP_SRCDIR)/VERSION.txt
	cd $(TOP_BUILDDIR) && $(SHELL) ./config.status $(thisdir)/$@

doxygen-config-perl.txt:  $(doxygen-perl-conf) $(TOP_SRCDIR)/VERSION.txt
	cd $(TOP_BUILDDIR) && $(SHELL) ./config.status $(thisdir)/$@

doxygen-config-matlab.txt:  $(doxygen-matlab-conf) $(TOP_SRCDIR)/VERSION.txt
	cd $(TOP_BUILDDIR) && $(SHELL) ./config.status $(thisdir)/$@

doxygen-config-octave.txt:  $(doxygen-octave-conf) $(TOP_SRCDIR)/VERSION.txt
	cd $(TOP_BUILDDIR) && $(SHELL) ./config.status $(thisdir)/$@

%.html: %.html.in
	cd $(TOP_BUILDDIR) && $(SHELL) ./config.status $(thisdir)/$@

expanded-html-files = \
  common-text/libsbml-downloading.html        \
  common-text/libsbml-group-comp-intro.html   \
  common-text/libsbml-group-fbc-intro.html    \
  common-text/libsbml-group-groups-intro.html  \
  common-text/libsbml-group-layout-intro.html \
  common-text/libsbml-group-qual-intro.html   \
  common-text/libsbml-installation.html

other-generated-files = \
  libsbml-converters.txt

core-sources =					  \
  $(wildcard ../../src/sbml/*.[cpp,h])		  \
  $(wildcard ../../src/sbml/*/*.[cpp,h])	  \
  $(wildcard ../../src/sbml/packages/*/*.[cpp,h]) \
  $(wildcard ../../src/sbml/bindings/*/*.[cpp,h])

all-sources =		     \
  $(wildcard libsbml-*.txt)  \
  $(wildcard libsbml-*.html) \
  $(core-sources)	     \
  $(expanded-html-files)     \
  $(other-generated-files)

css/libsbml-package-stylesheet.css: utilities/generate-pkg-stylesheet.py \
  $(all-sources) css/libsbml-javadoc-stylesheet.css
	utilities/generate-pkg-stylesheet.py $(TOP_SRCDIR)/src/sbml/packages > $@

css-files =			     \
  css/libsbml-base-stylesheet.css    \
  css/libsbml-c-stylesheet.css       \
  css/libsbml-doxygen-navtree.css    \
  css/libsbml-doxygen-stylesheet.css \
  css/libsbml-doxygen-tabs.css	     \
  css/libsbml-javadoc-stylesheet.css \
  css/libsbml-package-stylesheet.css \
  css/libsbml-python-stylesheet.css  \
  css/libsbml-reset-stylesheet.css	

# The file class-list.txt is used in a couple of places, and one of them is
# not immediately obvious: it's used by filters/doc-filter-c.py, which is
# called by Doxygen when creating the C manual.  The configuration setting
# that references doc-filter-c.py is in doxygen-config-c.txt.

class-list.txt: $(core-sources) utilities/generate-class-name-list.py
	utilities/generate-class-name-list.py $(TOP_SRCDIR)/src > $@

libsbml-converters.txt: class-list.txt utilities/generate-converters-list.py
	utilities/generate-converters-list.py class-list.txt > $@

define compare_constants
  utilities/compare-constants.py $(1) $(2)
endef

define compare_classes
  utilities/compare-classes.py $(TOP_SRCDIR)/src
endef

# If this copy of libSBML hasn't been configured with Doxygen support, we
# throw an error in the "else" clause of the next conditional.

ifneq "$(USE_DOXYGEN)" ""

doxygen-minor-version = $(shell $(DOXYGEN) --version | cut -f2 -d'.')

define preprocess_doxygen
  $(call compare_classes)
  if test $(doxygen-minor-version) -ge 8; then \
    echo "MARKDOWN_SUPPORT = NO" > doxygen-version-specific.txt; \
  else \
    echo "" > doxygen-version-specific.txt; \
  fi
endef

# The use of @addindex in the next block of code is a hack, used only because
# it's a Doxygen command that takes an argument but otherwise has no effect
# on the output we generate.  We ultimately need to use @ingroup, but when
# it's used for grouping classes, Doxygen (at least in version 1.8.5) fails
# to include the classes in the table of contents for the navigation panel
# along the left-hand side of the documentation pages.  To work around this
# problem, we do a first Doxygen pass where we hide the use of @ingroup,
# using this hack of redefining @sbmlpackage as @addindex (which is a no-op
# for us).  In the second (final) pass, we expose the @ingroup command by
# defining @sbmlpackage to be @ingroup.  This results in the table of
# contents lacking all the classes flagged with @ingroup.  To solve that,
# we copy over the index files created from the first Doxygen pass.

#

define run_doxygen
   $(call doxygen_indexing_pass,$(1),$(2),$(3))
   $(call doxygen_final_pass,$(1),$(2),$(3))
endef

define doxygen_indexing_pass
  @echo "-----------------------------------------------------------------"
  @echo "Running Doxygen pass 1 of 2: generate corrected table of contents"
  @echo "-----------------------------------------------------------------"
  rm -f doxygen-config.txt
  cp $(1) doxygen-config.txt
  echo 'ALIASES += sbmlpackage{1}="@addindex \1"' >> doxygen-config.txt
  if test -n $(3); then \
    $(DOXYGEN) doxygen-config.txt 2>&1 | egrep -v $(3); \
  else \
    $(DOXYGEN) doxygen-config.txt; \
  fi
  cp -f $(2)/navtreeindex*.js .
  cp -f $(2)/navtree*.js .
  cp -f $(2)/files.js .
endef

define doxygen_final_pass
  @echo "-----------------------------------------------------------------"
  @echo "Running Doxygen pass 2 of 2: generate final output"
  @echo "-----------------------------------------------------------------"
  rm -f doxygen-config.txt
  cp $(1) doxygen-config.txt
  echo 'ALIASES += sbmlpackage{1}="@ingroup \1"' >> doxygen-config.txt
  if test -n $(3); then \
    $(DOXYGEN) doxygen-config.txt 2>&1 | egrep -v $(3); \
  else \
    $(DOXYGEN) doxygen-config.txt; \
  fi
  cp -f navtreeindex*.js $(2)
  cp -f navtree.js $(2)
  cp -f navtree*.js $(2)
  cp -f files.js $(2)
  rm navtreeindex*.js
  rm navtree.js
  rm navtreedata.js
  rm files.js
endef

define postprocess_doxygen
  cp $(logo-files) $(1)
  cp common-graphics/*.txt $(1)
  cp common-graphics/*.gif $(1)
  cp common-graphics/*.png $(1)
  cp common-graphics/*.jpg $(1)
  cp common-graphics/*.svg $(1)
  cp sbml.js $(1)
  cp -rf css/libsbml-reset-stylesheet.css $(1)
  cp -rf css/libsbml-base-stylesheet.css $(1)
  cp -rf css/libsbml-package-stylesheet.css $(1)
  cp -rf css/libsbml-doxygen-tabs.css $(1)/tabs.css
  cp -rf css/libsbml-doxygen-navtree.css $(1)/navtree.css
endef

cpp-manual $(cpp-manual): doxygen-config-cpp.txt $(all-sources) $(css-files)
	mkdir -p $(cpp-manual)
	$(call preprocess_doxygen)
	$(call run_doxygen,doxygen-config-cpp.txt,$(cpp-manual),"")
	$(call postprocess_doxygen,$(cpp-manual))

c-manual $(c-manual): doxygen-config-c.txt $(all-sources) $(css-files) \
  filters/doc-filter-c.py class-list.txt
	mkdir -p $(c-manual)
	$(call preprocess_doxygen)
	$(call run_doxygen,doxygen-config-c.txt,$(c-manual),"")
	$(call postprocess_doxygen,$(c-manual))
	cp -f css/libsbml-c-stylesheet.css $(c-manual)

ifdef USE_PYTHON

python-input	     = ../../src/bindings/python/libsbml-doxygen.py
python-subst-dir     = python-substitutions
python-substitutions = $(wildcard $(python-subst-dir)/*.py)
python-sources	     =	     \
  $(wildcard libsbml-*.txt)  \
  $(wildcard libsbml-*.html) \
  $(python-input)	     \
  $(python-substitions)	     \
  $(expanded-html-files)     \
  $(other-generated-files)   \
  $(css-files)

# Certain things like parameters will never match up in Doxygen.
# Ignore those warnings to avoid confusing people.

python-ignorable-warnings = \
  "is not found in the argument list|The following parameters of libsbml|parameter 'args'|multiple use of section label"

python-manual $(python-manual): doxygen-config-python.txt $(python-sources) \
  filters/doc-filter-python.py class-list.txt
	mkdir -p $(python-manual)
	$(call compare_constants,$(python-input),python-substitutions/libsbml.py)
	utilities/pythondocpreprocessor.py $(python-input) libsbml.py $(python-substitutions)
	$(call preprocess_doxygen)
	$(call run_doxygen,doxygen-config-python.txt,$(python-manual),$(python-ignorable-warnings))
	$(call postprocess_doxygen,$(python-manual))
	cp -f css/libsbml-python-stylesheet.css $(python-manual)

endif

ifdef USE_PERL

perl-sources = ../../src/bindings/perl/LibSBML.pm

perl-manual $(perl-manual): doxygen-config-perl.txt $(perl-sources)
	mkdir -p $(perl-manual)
	$(call preprocess_doxygen)
	$(call run_doxygen,doxygen-config-perl.txt,$(c-manual),"")
	$(call postprocess_doxygen,$(perl-manual))

endif

ifdef USE_MATLAB

matlab-sources = \
  $(wildcard ../../src/bindings/matlab/*.m ../../src/bindings/matlab/*.c)

matlab-manual $(matlab-manual): doxygen-config-matlab.txt $(matlab-sources)
	mkdir -p $(matlab-manual)
	$(call preprocess_doxygen)
	$(DOXYGEN) doxygen-config-matlab.txt
	$(call postprocess_doxygen,$(matlab-manual))
endif

ifdef USE_OCTAVE

octave-sources = \
  $(wildcard ../../src/bindings/octave/*.m ../../src/bindings/octave/*.c)

octave-manual $(octave-manual): doxygen-config-octave.txt $(octave-sources)
	mkdir -p $(octave-manual)
	$(call preprocess_doxygen)
	$(DOXYGEN) doxygen-config-octave.txt
	$(call postprocess_doxygen,$(octave-manual))

endif

ifdef USE_CSHARP

# Some differences are just really hard to deal with.  Let's ignore warnings
# we can't currently do anything about, and that are harmless.

cs-ignorable-warnings = \
  "is not found in the argument list of|explicit link request to 'GO' could not be resolved|multiple use of section label"

csharp-manual $(csharp-manual): doxygen-config-csharp.txt $(all-sources) \
  $(css-files)
	mkdir -p $(csharp-manual)
	$(call preprocess_doxygen)
	$(call run_doxygen,doxygen-config-csharp.txt,$(csharp-manual),$(cs-ignorable-warnings))
	$(call postprocess_doxygen,$(csharp-manual))

endif

else
# Doxygen hasn't been configured suitably.

define nodoxygen
  Cannot make this manual, either because libSBML was not configured
  using --with-doxygen, or 'doxygen' cannot be found, or the version
  of 'doxygen' found is too old.  Please reconfigure with a suitable
  value for the configuration flag --with-doxygen.
endef

cpp-manual c-manual perl-manual python-manual:
	$(error $(nodoxygen))

endif

#
# Rules for making the Java manual.
#
# This runs Javadoc on the .java files in src/bindings/java/java-files/ and
# doesn't need doxygen at all.  The Java bindings need to have been created
# first, which should be the case for the copy of libSBML that's shipped
# anyway even if the end users does not configure --with-java.  Creating
# the Java bindings should have run src/bindings/swig/swigdoc.py as a
# by-product.  Our swigdoc.py program has the task of inserting back into
# the .java files the documentation comments that are currently left out by
# swig itself.
#

ifdef USE_JAVA

javadoc-doctitle    = "@PACKAGE_NAME@ @PACKAGE_VERSION@ Java API Reference"
javadoc-header      = "<B>@PACKAGE_NAME@<BR>@PACKAGE_VERSION@</B>"
javadoc-footer      = "`cat libsbml-java-footer.html`"
javadoc-windowtitle = "LibSBML Java API"

define substitute_version
  perl -i -pe 's/%%version%%/@PACKAGE_VERSION@/g' $(java-manual)/$(java-class-path)/*.html
endef

define merge_html
  cat libsbml-java-top.html $(1) libsbml-java-bottom.html \
  libsbml-java-footer.html \
  | perl -pe 's/%%title%%/$(3)/g;s/%%version%%/@PACKAGE_VERSION@/g' \
  > $(java-manual)/$(2)
endef

define merge_html_verb
  cat libsbml-java-top.html libsbml-java-verb-top.html $(1) \
  libsbml-java-verb-bottom.html libsbml-java-bottom.html \
  libsbml-java-footer.html \
  | perl -pe 's/%%title%%/$(3)/g;s/%%version%%/@PACKAGE_VERSION@/g' \
  > $(java-manual)/$(2)
endef

define merge_java_example
  $(shell cat libsbml-java-example-top.html $(1) \
  libsbml-java-example-bottom.html libsbml-java-example-footer.html \
  | perl -pe 's/%%title%%/$(notdir $(1))/g;s/%%version%%/@PACKAGE_VERSION@/g' \
  > $(java-manual)/examples/$(notdir $(1)).html)
endef

define insert_javascript
  perl -i -pe 's|<SCRIPT type="text/javascript">|<script src="../../../sbml.js"></script><SCRIPT type="text/javascript">|ig' $(wildcard $(1)/*.html)
endef

define rewrite_links
  perl -i -pe 's|<FONT CLASS="NavBarFont1"><B>Package|<FONT CLASS="NavBarFont1"><B>org.sbml.libsbml|ig' $(wildcard $(1)/*.html)
  perl -i -pe 's|<FONT CLASS="NavBarFont1 top-level"><B>Package|<FONT CLASS="NavBarFont1 top-level"><B>org.sbml.libsbml|ig' $(wildcard $(1)/*.html)
  perl -i -pe 's|org.sbml.libsbml</B></FONT></A>&nbsp;</TD>|org.sbml.libsbml</B></FONT></A>&nbsp;</TD>\n  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="$(2)extensions-summary.html"><FONT CLASS="NavBarFont1"><B>Level 3 Extensions</B></FONT></A>&nbsp;</TD>|ig' $(wildcard $(1)/*.html)
endef

define adjust_frameset_in_file
  perl -i -pe 's/20%,80%/26%,74%/' $(1)
endef

define fix_broken_highlighting
  perl -i -pe 's|<FONT CLASS="NavBarFont1"><B>org.sbml.libsbml|<FONT CLASS="NavBarFont1 selected"><B>org.sbml.libsbml|ig' \
    $(java-manual)/index.html
  perl -i -pe 's|<FONT CLASS="NavBarFont1"><B>org.sbml.libsbml|<FONT CLASS="NavBarFont1 selected"><B>org.sbml.libsbml|ig' \
    $(java-manual)/$(java-class-path)/package-summary.html
  perl -i -pe 's|CLASS="NavBarFont1"><B>Level 3 Extensions|CLASS="NavBarFont1 selected"><B>Level 3 Extensions|ig' \
    $(java-manual)/extensions-summary.html
  perl -i -pe 's|NavBarFont1 top-level|NavBarFont1|g' \
    $(java-manual)/extensions-summary.html
endef

define create_extensions_page
  utilities/generate-extensions-summary.py $(1) > java-extensions-list.html
  $(call merge_html,java-extensions-list.html,extensions-summary.html,LibSBML extensions for SBML Level 3 packages)
  rm -f java-extensions-list.html
endef


# Compile the SBMLDoclet class file if needed.

SBMLDoclet.class: SBMLDoclet.java
	$(JAVAC) -nowarn -cp $(JAVADOC_JAR) $<

# Rerun configure if needed.

java-substitutions/libsbmlConstants.java: java-substitutions/libsbmlConstants.java.in
	cd $(TOP_BUILDDIR) && $(SHELL) ./config.status $(thisdir)/$@

# There are certain things I can't figure out how to make compatible
# between doxygen and javadoc.  Let's ignore the warnings to avoid
# confusing users.

java-ignorable-warnings = "warning - @param argument|Custom tags that could"

# 2011-02-13 <mhucka@caltech.edu> We now do an evil work-around for the
# problem that SWIG refuses to attach documentation to certain things:
#
#   1. copy the Java sources produced by our SWIG + swigdoc.py to a local dir
#   2. overwrite certain files in this local dir with static, documented copies
#   3. then run javadoc on this local dir instead of the real Java sources
#
# Yes, heinous, and it will bite us in the ass some day when we forget to
# update the static copies.  But believe me, I spent hours trying to find
# a way to do the right thing with SWIG, or javadoc, and this is the least
# complicated approach.

java-source-dir	    = ../../src/bindings/java/java-files
java-local-dir	    = java-files
java-subst-dir	    = java-substitutions
java-class-path	    = org/sbml/libsbml
java-constants-file = $(java-source-dir)/org/sbml/libsbml/libsbmlConstants.java

java-manual $(java-manual): $(all-sources) $(css-files) SBMLDoclet.class \
    java-substitutions/libsbmlConstants.java
	$(call compare_classes)
	$(call compare_constants,$(java-constants-file),$(java-subst-dir)/libsbmlConstants.java)
	rm -rf $(java-local-dir)
	mkdir -p $(java-local-dir)/$(java-class-path)
	cp -rp $(java-source-dir)/$(java-class-path)/* $(java-local-dir)/$(java-class-path)
	cp -rp $(java-subst-dir)/* $(java-local-dir)/$(java-class-path)
	$(JAVA) -cp $(JAVADOC_JAR):. SBMLDoclet \
	    -use -public -version -author -sourcetab 4 -keywords -nohelp \
	    -link http://docs.oracle.com/javase/1.6.0/docs/api \
	    -header $(javadoc-header) \
	    -bottom $(javadoc-footer) \
	    -windowtitle $(javadoc-windowtitle) \
	    -doctitle $(javadoc-doctitle) \
	    -overview libsbml-java-fake-overview.html \
	    -stylesheetfile css/libsbml-javadoc-stylesheet.css \
	    -d $(java-manual) \
	    -tag note:a:"Note:" \
	    -tag warning:a:"Warning:" \
	    -sourcepath $(java-local-dir) org.sbml.libsbml \
        2>&1 | egrep -v $(java-ignorable-warnings)
	cp -f $(css-files) $(java-manual)
	cp -f $(css-files) $(java-manual)/$(java-class-path)
	cp -f utilities/prettify/prettify.js utilities/prettify/prettify.css $(java-manual)
	cp -f $(logo-files) $(java-manual)
	cp -f $(logo-files) $(java-manual)/$(java-class-path)/
	cp -f common-graphics/*.gif $(java-manual)
	cp -f common-graphics/*.png $(java-manual)
	cp -f common-graphics/*.png $(java-manual)/$(java-class-path)/
	cp -f common-graphics/*.png $(java-manual)/$(java-class-path)/class-use
	cp -f common-graphics/*.svg $(java-manual)
	cp -f common-graphics/*.svg $(java-manual)/$(java-class-path)/
	cp -f common-graphics/*.svg $(java-manual)/$(java-class-path)/class-use
	cp -f common-graphics/*.jpg $(java-manual)
	cp -f common-graphics/*.jpg $(java-manual)/$(java-class-path)/
	cp -f common-graphics/*.jpg $(java-manual)/$(java-class-path)/class-use
	cp -f sbml.js $(java-manual)
	cp -f sbml.js $(java-manual)/$(java-class-path)/
	$(call merge_html,libsbml-java-overview.html,overview-summary.html,LibSBML Java @PACKAGE_VERSION@ API)
	$(call merge_html,libsbml-java-installation-guide.html,libsbml-java-installation-guide.html,LibSBML installation)
	$(call merge_html,libsbml-java-reading.html,libsbml-java-reading.html,Reading and writing SBML content)
	$(call merge_html,libsbml-java-math.html,libsbml-java-math.html,Manipulating mathematical expressions)
	$(call merge_html,libsbml-java-misc.html,libsbml-java-misc.html,Miscellaneous Java-specific information)
	$(call merge_html,libsbml-java-example-files.html,libsbml-java-example-files.html,Example libSBML programs in Java)
	$(call merge_html,common-text/libsbml-installation.html,libsbml-installation.html,LibSBML installation)
	$(call merge_html,common-text/libsbml-downloading.html,libsbml-downloading.html,LibSBML downloads)
	$(call merge_html,common-text/libsbml-features.html,libsbml-features.html,LibSBML features)
	$(call merge_html,common-text/libsbml-setting-library-path.html,libsbml-setting-library-path.html,Setting your library search path)
	$(call merge_html,common-text/libsbml-import-for-java.html,libsbml-import-for-java.html,Accessing libSBML from Java software)
	$(call merge_html,common-text/libsbml-communications.html,libsbml-communications.html,Bug reports and other communications)
	$(call merge_html,common-text/libsbml-issues.html,libsbml-issues.html,Known issues and pitfalls)
	$(call merge_html,common-text/sbml-specifications-table.html,libsbml-specifications.html,SBML specifications)
	$(call merge_html,../../LICENSE.html,libsbml-license.html,LibSBML license)
	$(call merge_html_verb,../../NEWS.txt,libsbml-news.html,LibSBML news)
	mkdir -p $(java-manual)/examples
	${MAKE} postprocess_javadoc
	${MAKE} create_java_examples

postprocess_javadoc:;
	$(call create_extensions_page,$(java-manual)/$(java-class-path)/package-summary.html)
	$(call insert_javascript,$(java-manual)/$(java-class-path))
	$(call rewrite_links,$(java-manual),)
	$(call rewrite_links,$(java-manual)/$(java-class-path),../../../)
	$(call rewrite_links,$(java-manual)/$(java-class-path)/class-use,../../../../)
	$(call adjust_frameset_in_file,$(java-manual)/index.html)
	$(call fix_broken_highlighting)
	$(call substitute_version)

create_java_examples:;
	$(foreach file,$(wildcard ../../examples/java/*.java),$(call merge_java_example,$(file)))
	$(foreach file,$(wildcard ../../examples/java/*/*.java),$(call merge_java_example,$(file)))

endif


# -----------------------------------------------------------------------------
# Miscellaneous helpers.
# -----------------------------------------------------------------------------

$(pdffiles): %.pdf: %.eps
	epstopdf $<


# -----------------------------------------------------------------------------
# Installation.
# -----------------------------------------------------------------------------

# This needs a special version of install-docs, because the source pathnames
# have ../formatted in them and we need to strip that out when copying to
# the destination directory.

install install-docs: $(docs)
	if test -z '$(docs)'; then \
	  echo 'Nothing to be done for install-docs'; \
	else \
	  list='$(docs)'; for docdir in $$list; do \
	    if test -d $$docdir; then d=.; else d=$(srcdir); fi; \
	    dirname=`basename "$$docdir"`; \
	    if test "$$dirname" != "$$docdir" && test "$$dirname" != "."; then \
	      $(MKINSTALLDIRS) "$(DESTDIR)$(DOCDIR)/$$dirname"; \
	    fi; \
	    echo Copying to $(DESTDIR)$(DOCDIR)/$$dirname; \
	    if test -d $$d/$$docdir; then \
	      if test -d $(srcdir)/$$docdir && test $$d != $(srcdir); then \
	        cp -pR $(srcdir)/$$docdir $(DESTDIR)$(DOCDIR) || exit 1; \
	      else \
	        cp -pR $$d/$$docdir $(DESTDIR)$(DOCDIR) || exit 1; \
	      fi; \
	    else \
	      test -f $(DESTDIR)$(DOCDIR)/$$docdir \
	      || cp -p $$d/$$docdir $(DESTDIR)$(DOCDIR)/$$dirname \
	      || exit 1; \
	    fi; \
	  done; \
	fi

uninstall:

installcheck:


# -----------------------------------------------------------------------------
# Creating distribution (for libSBML maintainers only)
# -----------------------------------------------------------------------------

#dist: dist-normal $(docs) # 2007-06-05 going to distribute docs separately.
dist: dist-normal

distcheck:


# -----------------------------------------------------------------------------
# Common default rules.
# -----------------------------------------------------------------------------

include @top_srcdir@/config/makefile-common-actions.mk


# -----------------------------------------------------------------------------
# End.
# -----------------------------------------------------------------------------

# No longer used:

#preformatted_files     = java.txt python.txt
#generated_manual_files = libsbml-manual libsbml-manual.pdf
#generated_apiref_files = libsbml-api-ref.pdf
#all_generated_files    = $(generated_manual_files) $(generated_apiref_files)
#all_doc_files          = $(all_generated_files) $(preformatted_files)

#docs                   = $(foreach d,$(all_doc_files),$(formatted)/$d)


#api-tex-files := $(wildcard api/*.tex)

#api/.timestamp:
#	$(SHELL) createAPISections.sh ../../src/sbml
#	echo `date` > api/.timestamp

#$(formatted)/libsbml-api-ref.pdf libsbml-api-ref.pdf: libsbml-api-ref.tex \
#  api/.timestamp $(api-tex-files)
#	-@/bin/rm -f libsbml-api-ref.toc libsbml-api-ref.aux
#	$(latex-env) pdflatex libsbml-api-ref
#	$(latex-env) bibtex libsbml-api-ref
#	$(latex-env) pdflatex libsbml-api-ref
#	$(latex-env) pdflatex libsbml-api-ref
#	$(latex-env) pdflatex libsbml-api-ref
#	cp -f libsbml-api-ref.pdf $(formatted)

#$(formatted)/libsbml-api-ref.dvi: libsbml-api-ref.tex \
#  api/.timestamp $(api-tex-files)
#	-@/bin/rm -f libsbml-api-ref.toc libsbml-api-ref.aux
#	$(latex-env) latex libsbml-api-ref
#	$(latex-env) bibtex libsbml-api-ref
#	$(latex-env) latex libsbml-api-ref
#	$(latex-env) latex libsbml-api-ref
#	$(latex-env) latex libsbml-api-ref
#	cp -f libsbml-api-ref.dvi $(formatted)

#$(formatted)/libsbml-api-ref.ps libsbml-api-ref.ps:  $(formatted)/libsbml-api-ref.dvi
#	$(latex-env) dvips -o libsbml-api-ref.ps libsbml-api-ref
#	cp -f libsbml-api-ref.ps $(formatted)

# doxygen-output-dir = libsbml-api-ref

# $(formatted)/libsbml-api-ref libsbml-api-ref: Doxyfile $(wildcard ../../src/*/*.[cpp,h])
#	$(shell [ -d $(doxygen-output-dir) ] || mkdir $(doxygen-output-dir))
#	doxygen Doxyfile
#	cp -rf tabs.css $(doxygen-output-dir)
#	cp common-graphics/sbml-logo-long-124x56.gif $(doxygen-output-dir)
#	cp libsbml-api-ref.html.tmpl libsbml-api-ref.html
#	cp -rf libsbml-api-ref $(formatted)

## -----------------------------------------------------------------------------
## libsbml-manual
## -----------------------------------------------------------------------------

#manual_html_dir = libsbml-manual

#epsfiles        = $(wildcard common-graphics/*.eps)
#pdffiles        = $(epsfiles:.eps=.pdf)

#latex-env := TEXINPUTS=".:tex//:../tex//:${TEXINPUTS}::"

## Check that these files are up-to-date w.r.t. libsbml's version number.
## This helps catch the situation where a person does a CVS update and
## the version number changes, but the person doesn't remember to do a
## reconfigure.

#tex/libsbmlextras.sty: $(TOP_SRCDIR)/VERSION.txt $(TOP_SRCDIR)/FUNDING.txt
#	cd $(TOP_BUILDDIR) && \
#	    $(SHELL) ./config.status $(thisdir)/tex/libsbmlextras.sty

## Yes, run pdflatex 4 times after running bibtex here.

#manual $(formatted)/libsbml-manual.pdf libsbml-manual.pdf: libsbml-manual.tex $(pdffiles)
#	-@/bin/rm -f libsbml-manual.toc libsbml-manual.aux
#	$(latex-env) pdflatex libsbml-manual
#	$(latex-env) bibtex libsbml-manual
#	$(latex-env) pdflatex libsbml-manual
#	$(latex-env) pdflatex libsbml-manual
#	$(latex-env) pdflatex libsbml-manual
#	cp -f libsbml-manual.pdf $(formatted)

#$(formatted)/libsbml-manual.dvi: libsbml-manual.tex $(epsfiles)
#	-@/bin/rm -f libsbml-manual.toc libsbml-manual.aux
#	$(latex-env) latex libsbml-manual
#	$(latex-env) bibtex libsbml-manual
#	$(latex-env) latex libsbml-manual
#	$(latex-env) latex libsbml-manual
#	$(latex-env) latex libsbml-manual
#	cp -f libsbml-manual.dvi $(formatted)

#$(formatted)/libsbml-manual.ps libsbml-manual.ps: $(formatted)/libsbml-manual.dvi
#	$(latex-env) dvips -o libsbml-manual.ps libsbml-manual
#	cp -f libsbml-manual.ps $(formatted)

## latex2html wants a .aux file

#$(formatted)/libsbml-manual libsbml-manual: libsbml-manual.tex $(formatted)/libsbml-manual.pdf
#	@test -L ./sbmlmanual.perl || ln -s tex/sbmlmanual.perl
#	@test -L ./libsbmlextras.perl || ln -s tex/libsbmlextras.perl
#	$(latex-env) latex2html -white -split +0 -show_section_numbers \
#		   -image_type gif -no_navigation -local_icons -discard \
#		   -antialias -t "libSBML $(PACKAGE_VERSION) Developer's Manual" \
#		   -mkdir -dir $(manual_html_dir) libsbml-manual
#	rm $(manual_html_dir)/index.html
#	cp -f libsbml-manual.css $(manual_html_dir)
#	cp tex/logos/sbml-logo-300x48.jpg $(manual_html_dir)
#	cd $(manual_html_dir) && ln -sf libsbml-manual.html index.html
#	perl -pi -e "s/<TITLE>Contents<\/TITLE>/<TITLE>libSBML Developer's Manual<\/TITLE>/" \
#		$(manual_html_dir)/libsbml-manual.html
#	cp -rf libsbml-manual $(formatted)

##		   -init_file libsbml-manual.init \
##	ln -s libsbml-manual.html $(manual_html_dir)/index.html
##	ln -sf $(manual_html_dir)/libsbml-manual.html
##	perl -pi -e "s|</HEAD>|</HEAD>\n<BASE HREF=\"libsbml-manual/\">|" \
##		$(manual_html_dir)/libsbml-manual.html
