UbuntuでDoxygenを使う方法と、普段、Fortranを使う際に使用しているDoxyfileの設定をメモしておこうと思います。
Ubuntuへのインストールはapt-getを使えば簡単。グラフを描画するためのGraphvizも一緒にインストールします。
sudo apt-get install doxygen graphviz
テンプレートは-gオプションを使うと自動生成できる。使うときは、doxygenの後ろにdoxyfileをそのまま指定すればよい。
$ doxygen -g doxyfile Configuration file `doxyfile' created. Now edit the configuration file and enter doxygen doxyfile to generate the documentation for your project
Fortran仕様にするためにはいくつかの設定を変更する必要がある。グラフ表示等のオプションをYESにする。
カスタマイズ後のDoxyfileでdiffをとった結果を示す。バージョンが1.7.6と1.8.1で異なるのでオプションが若干異なってしまっている。違いの検討はまた今度。
29c29 < PROJECT_NAME = "My Project" --- > PROJECT_NAME = "Fortran Project" 35c35 < PROJECT_NUMBER = --- > PROJECT_NUMBER = 0.1 64c64 < CREATE_SUBDIRS = NO --- > CREATE_SUBDIRS = YES 154c154 < JAVADOC_AUTOBRIEF = NO --- > JAVADOC_AUTOBRIEF = YES 162c162 < QT_AUTOBRIEF = NO --- > QT_AUTOBRIEF = YES 187c187 < TAB_SIZE = 8 --- > TAB_SIZE = 4 223c223 < OPTIMIZE_FOR_FORTRAN = NO --- > OPTIMIZE_FOR_FORTRAN = YES 242a243,251 > # If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all > # comments according to the Markdown format, which allows for more readable > # documentation. See http://daringfireball.net/projects/markdown/ for details. > # The output of markdown processing is further processed by doxygen, so you > # can mix doxygen, HTML, and XML commands with Markdown formatting. > # Disable only in case of backward compatibilities issues. > > MARKDOWN_SUPPORT = YES > 349c358 < EXTRACT_ALL = NO --- > EXTRACT_ALL = YES 354c363,367 < EXTRACT_PRIVATE = NO --- > EXTRACT_PRIVATE = YES > > # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation. > > EXTRACT_PACKAGE = YES 359c372 < EXTRACT_STATIC = NO --- > EXTRACT_STATIC = YES 442c455 < FORCE_LOCAL_INCLUDES = NO --- > FORCE_LOCAL_INCLUDES = YES 543,548d555 < # If the sources in your project are distributed over multiple directories < # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy < # in the documentation. The default is NO. < < SHOW_DIRECTORIES = NO < 669c676 < FILE_PATTERNS = --- > FILE_PATTERNS = *.f90 *.inc 675c682 < RECURSIVE = NO --- > RECURSIVE = YES 778c785 < SOURCE_BROWSER = NO --- > SOURCE_BROWSER = YES 783c790 < INLINE_SOURCES = NO --- > INLINE_SOURCES = YES 795c802 < REFERENCED_BY_RELATION = NO --- > REFERENCED_BY_RELATION = YES 801c808 < REFERENCES_RELATION = NO --- > REFERENCES_RELATION = YES 817c824 < USE_HTAGS = NO --- > USE_HTAGS = YES 861c868 < HTML_OUTPUT = html --- > HTML_OUTPUT = docs 937,942d943 < # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, < # files or namespaces will be aligned in HTML using tables. If set to < # NO a bullet list will be used. < < HTML_ALIGN_MEMBERS = YES < 950a950,960 > # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of > # entries shown in the various tree structured indices initially; the user > # can expand and collapse entries dynamically later on. Doxygen will expand > # the tree to such a level that at most the specified number of entries are > # visible (unless a fully collapsed tree already exceeds this amount). > # So setting the number of entries 1 will produce a full collapsed tree by > # default. 0 is a special value representing an infinite number of entries > # and will result in a full expanded tree by default. > > HTML_INDEX_NUM_ENTRIES = 100 > 1120c1130 < GENERATE_TREEVIEW = NO --- > GENERATE_TREEVIEW = YES 1129,1133d1138 < # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, < # and Class Hierarchy pages using a tree view instead of an ordered list. < < USE_INLINE_TREES = NO < 1179c1185 < MATHJAX_RELPATH = http://www.mathjax.org/mathjax --- > MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest 1213c1219 < GENERATE_LATEX = YES --- > GENERATE_LATEX = NO 1472c1478 < MACRO_EXPANSION = NO --- > MACRO_EXPANSION = YES 1600c1602 < HAVE_DOT = NO --- > HAVE_DOT = YES 1654a1657,1665 > # If the UML_LOOK tag is enabled, the fields and methods are shown inside > # the class node. If there are many fields or methods and many nodes the > # graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS > # threshold limits the number of items for each type to make the size more > # managable. Set this to 0 for no limit. Note that the threshold may be > # exceeded by 50% before the limit is enforced. > > UML_LIMIT_NUM_FIELDS = 10 > 1680c1691 < CALL_GRAPH = NO --- > CALL_GRAPH = YES 1688c1699 < CALLER_GRAPH = NO --- > CALLER_GRAPH = YES 1769c1780 < DOT_MULTI_TARGETS = YES --- > DOT_MULTI_TARGETS = NO