From fe32ac14239bbf61ab9508da7b565b725f391a20 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 5 Oct 2020 01:48:22 +0100 Subject: [PATCH] DOC: Add make rule and bash script to run doxygen The output directory is not defined by the DOXYGEN_OUTPUT_DIRECTORY environment variable instead of being hardcoded to `html`. Both the make rule and the bash script set that variable to `html` by default, but in the case of the bash script we can override it by defining the variable in the environement before running the script. --- Makefile.common | 3 ++- doc/doxygen/run_doxygen.sh | 8 ++++++++ doc/doxygen/scummvm.doxyfile | 6 +++--- doc/module.mk | 14 ++++++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100755 doc/doxygen/run_doxygen.sh create mode 100644 doc/module.mk diff --git a/Makefile.common b/Makefile.common index 804f8c11ff8..7a630bedc5d 100644 --- a/Makefile.common +++ b/Makefile.common @@ -35,7 +35,8 @@ MODULES += \ graphics \ audio \ common \ - po + po \ + doc ifdef USE_MT32EMU MODULES += audio/softsynth/mt32 diff --git a/doc/doxygen/run_doxygen.sh b/doc/doxygen/run_doxygen.sh new file mode 100755 index 00000000000..358b7f79778 --- /dev/null +++ b/doc/doxygen/run_doxygen.sh @@ -0,0 +1,8 @@ +#!/bin/bash +DOX_DIR="$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)" +if [ -z "$DOXYGEN_OUTPUT_DIRECTORY" ] ; then + export DOXYGEN_OUTPUT_DIRECTORY=${DOX_DIR}/html +fi +echo "Generating reference documentation in ${DOXYGEN_OUTPUT_DIRECTORY}..." +cd ${DOX_DIR} +doxygen scummvm.doxyfile diff --git a/doc/doxygen/scummvm.doxyfile b/doc/doxygen/scummvm.doxyfile index 02d89a80798..171b44f72b3 100644 --- a/doc/doxygen/scummvm.doxyfile +++ b/doc/doxygen/scummvm.doxyfile @@ -58,7 +58,7 @@ PROJECT_LOGO = buildfiles/scummvm_logo.png # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = html/ +OUTPUT_DIRECTORY = $(DOXYGEN_OUTPUT_DIRECTORY) # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -781,7 +781,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = html/doxygen_warnings.txt +WARN_LOGFILE = doxygen_warnings.txt #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -2481,4 +2481,4 @@ GENERATE_LEGEND = YES DOT_CLEANUP = YES -@INCLUDE = links.doxyfile \ No newline at end of file +@INCLUDE = links.doxyfile diff --git a/doc/module.mk b/doc/module.mk new file mode 100644 index 00000000000..8c9c4db5c8a --- /dev/null +++ b/doc/module.mk @@ -0,0 +1,14 @@ +DOXYGEN_OUTPUT_DIRECTORY := html +export DOXYGEN_OUTPUT_DIRECTORY + +doxygen: + @echo "Generating reference documentation in $(srcdir)/doc/doxygen/${DOXYGEN_OUTPUT_DIRECTORY}..." + @cd $(srcdir)/doc/doxygen ; doxygen scummvm.doxyfile + +clean-doxygen: + rm -rf $(srcdir)/doc/doxygen/html + rm -f $(srcdir)/doc/doxygen/doxygen_warnings.txt + +doc: doxygen + +clean-doc: clean-doxygen