3
# Doxygen run script for NWChem
5
# Doxygen is a source code documentation tool. It interprets and analyses
6
# the source code and writes a substantial chunk of documentation. The
7
# documentation can be enriched by providing more details in comment lines.
8
# Doxygen is the defacto standard approach to documenting C-code.
13
echo " Usage: $0 [-h] [-g] [-t] [-m] [-s] [-u] [-v] [-j]"
16
This script runs doxygen building a particular version of the NWChem source
17
code documentation. The command can be run in any directory and produces the
18
documentation in the directory ./doxydocs .
20
The command line flags are:
22
-h Show this information
24
-g Generate the full NWChem documentation, including various graphs such
25
as call trees, include trees, caller trees, etc. This is most useful
26
when information about how the code is put together is required.
27
This level of documentation takes the longest to generate and requires
28
the most disk space (about 80 minutes and generating around 4 GB of HTML).
30
-t (Default) Generate text only NWChem documentation. No graphs are generated
31
but headers and comments are included. This level of documentation is
32
useful when the information about how to use a module is required.
33
(Takes about 15 minutes and generates 300 MB of HTML).
35
-m Generate NWChem manpages. This is similar to the text only documentation
36
except that this documentation is formatted as UNIX manpages. This
37
documentation is relatively compact (takes about 10 minutes and generates
40
-s Generate the NWChem documentation including the full source code. The
41
source code is formatted in HTML with cross-references between the
42
documentation and source code. This is likely to get big but might be
43
useful in figuring out how Doxygen interprets a piece of source code.
44
(This takes about 15 minutes and generates about 1 GB of documentation).
46
-u Update the Doxygen configurations files to a newer version of Doxygen.
48
-v Print the version information from the configuration files, Doxygen,
49
and the GraphViz dot program.
51
-j Enable MathJax to display equations. MathJax is a JavaScript display engine
52
that displays equations in your browser without needing any readers or
53
plugins. Because it processes equations in your browser the speed will
54
depend on your machine performance and your browser. For example Internet
55
Explorer 8 took minutes to process a page and was unusably slow afterwards,
56
whereas Firefox 16 processed the same page in seconds and displayed without
57
noticable degradation.
62
# The first item on the command line is an actual file so it must have
63
# been specified including the path.
64
path="`dirname \"$0\"`"
66
# The first item on the command line is not a file so it must have been
69
path="`dirname \"$path\"`"
72
if [ $# -gt 2 ] ; then
76
while [ $# -ge 1 ] ; do
78
-h) task="help" ; shift 1 ;;
79
-g) task="graph" ; shift 1 ;;
80
-t) task="text" ; shift 1 ;;
81
-m) task="man" ; shift 1 ;;
82
-s) task="src" ; shift 1 ;;
83
-u) task="update" ; shift 1 ;;
84
-v) task="version" ; shift 1 ;;
85
-j) mjax="yes" ; shift 1 ;;
86
*) task="usage" ; shift 1 ;;
90
# Now we need to do something about the Doxygen configuration with respect to
91
# the locations of the include files. We cannot point to the common include
92
# directory as Doxygen will also find the include files in the source code
93
# directories. When Doxygen finds the same entities twice it gets confused
94
# and rejects all copies. So we need to find the include files in the source
95
# code directories, work out the set of unique directories they live in, and
96
# insert this into the Doxygen configuration file. After that we can invoke
99
echo "configuring Doxygen..."
100
echo "finding paths for include files..."
101
includedirs=`find "${path}/../../src" -name "*.*h" -print `
103
for file in $includedirs ; do
104
echo `dirname $file` >> doxya$$.tmp
106
grep -v "src/include" doxya$$.tmp | grep -v "install/include" | grep -v "tools/include" | sort -u > doxyb$$.tmp
107
includedirs=`cat doxyb$$.tmp`
108
echo "adding the include files paths:"
110
rm -f doxya$$.tmp doxyb$$.tmp
112
if [ "$task" == "help" ] ; then
115
elif [ "$task" == "graph" ] ; then
117
grep -v "INCLUDE_PATH =" "$path/doxygen.rc" > "$path/doxygen$$.rc"
118
echo "INCLUDE_PATH =" $includedirs >> "$path/doxygen$$.rc"
119
if [ ${#mjax} -ne 0 ] ; then
120
echo "USE_MATHJAX = YES" >> "$path/doxygen$$.rc"
122
doxygen "$path/doxygen$$.rc"
123
rm -f "$path/doxygen$$.rc"
125
elif [ "$task" == "text" ] ; then
127
grep -v "INCLUDE_PATH =" "$path/doxygen-text.rc" > "$path/doxygen-text$$.rc"
128
echo "INCLUDE_PATH =" $includedirs >> "$path/doxygen-text$$.rc"
129
if [ ${#mjax} -ne 0 ] ; then
130
echo "USE_MATHJAX = YES" >> "$path/doxygen-text$$.rc"
132
doxygen "$path/doxygen-text$$.rc"
133
rm -f "$path/doxygen-text$$.rc"
135
elif [ "$task" == "man" ] ; then
137
grep -v "INCLUDE_PATH =" "$path/doxygen-manpage.rc" > "$path/doxygen-manpage$$.rc"
138
echo "INCLUDE_PATH =" $includedirs >> "$path/doxygen-manpage$$.rc"
139
doxygen "$path/doxygen-manpage$$.rc"
140
rm -f "$path/doxygen-manpage$$.rc"
142
elif [ "$task" == "src" ] ; then
144
grep -v "INCLUDE_PATH =" "$path/doxygen-src.rc" > "$path/doxygen-src$$.rc"
145
echo "INCLUDE_PATH =" $includedirs >> "$path/doxygen-src$$.rc"
146
if [ ${#mjax} -ne 0 ] ; then
147
echo "USE_MATHJAX = YES" >> "$path/doxygen-src$$.rc"
149
doxygen "$path/doxygen-src$$.rc"
150
rm -f "$path/doxygen-src$$.rc"
152
elif [ "$task" == "update" ] ; then
153
doxygen -u "$path/doxygen.rc"
154
doxygen -u "$path/doxygen-src.rc"
155
doxygen -u "$path/doxygen-text.rc"
156
doxygen -u "$path/doxygen-manpage.rc"
157
elif [ "$task" == "version" ] ; then
158
grep Doxyfile "$path"/*.rc
159
echo -n "Doxygen "; doxygen --version