Last Update: "2008/12/20 11:35:58 makoto"

doxygen

Doxygen って何という向きには: http://www.fides.dti.ne.jp/~oka-t/doxygen-manual/html/

あるいは: http://www.fides.dti.ne.jp/~oka-t/doxygen.html

devel/doxygen で make install あるいは make package をしたら、 動作確認をします
動作例として... (別に何でもいい訳ですが)
http://www.systemc.org/の systemC-2.0.1 を使います(簡単な登録が必要です)。 About SystemC -> download からもらって来ます。

-rw-r--r--  1 makoto  wheel  1590044 Feb 13 20:09 /e/u/j/distfiles/systemc-2.0.1.tgz

Doxyfile

tar zxf systemc-2.0.1.tgz で開けてから
cd systemc-2.0.1/src/systemc doxygen -g
とすると Doxyfile というものを作ってくれます。 (これは実はどこに cd して作っても同じものが作られます。 cd が意味があるのは、作られたものを保存する位置のためです) その名前を変えて Doxyfile-template として保存しておきます。 それを Doxyfile に写して、設定します。
-rw-r--r--  1 makoto  wheel  49899 Feb 14 14:34 Doxyfile
-rw-r--r--  1 makoto  wheel  49833 Feb 14 14:09 Doxyfile-template
それを更に変更して、 今使っているのは次のようなものです( これだけだと CALLER_GRAPH が生成されませんので 以下を参照のこと。また gcc-4.1.1 の場合 も参照して下さい。
--- Doxyfile-template	2006-02-14 14:09:20.000000000 +0900
+++ Doxyfile	2006-02-14 17:33:39.000000000 +0900
@@ -17,7 +17,7 @@
 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
 # by quotes) that should identify the project.
 
-PROJECT_NAME           = 
+PROJECT_NAME           = systemc
 
 # The PROJECT_NUMBER tag can be used to enter a project or revision number. 
 # This could be handy for archiving the generated documentation or 
@@ -51,7 +51,7 @@
 # Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
 # Swedish, and Ukrainian.
 
-OUTPUT_LANGUAGE        = English
+OUTPUT_LANGUAGE        = Japanese
 
 # This tag can be used to specify the encoding used in the generated output. 
 # The encoding is not always determined by the language that is chosen, 
@@ -213,17 +213,17 @@
 # Private class members and static file members will be hidden unless 
 # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
 
-EXTRACT_ALL            = NO
+EXTRACT_ALL            = YES
 
 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
 # will be included in the documentation.
 
-EXTRACT_PRIVATE        = NO
+EXTRACT_PRIVATE        = YES
 
 # If the EXTRACT_STATIC tag is set to YES all static members of a file 
 # will be included in the documentation.
 
-EXTRACT_STATIC         = NO
+EXTRACT_STATIC         = YES
 
 # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
 # defined locally in source files will be included in the documentation. 
@@ -459,7 +459,7 @@
 # should be searched for input files as well. Possible values are YES and NO. 
 # If left blank NO is used.
 
-RECURSIVE              = NO
+RECURSIVE              = YES
 
 # The EXCLUDE tag can be used to specify files and/or directories that should 
 # excluded from the INPUT source files. This way you can easily exclude a 
@@ -723,7 +723,7 @@
 # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
 # invoked. If left blank `latex' will be used as the default command name.
 
-LATEX_CMD_NAME         = latex
+LATEX_CMD_NAME         = platex
 
 # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
 # generate index for LaTeX. If left blank `makeindex' will be used as the 
@@ -1116,7 +1116,7 @@
 # So in most cases it will be better to enable call graphs for selected 
 # functions only using the \callgraph command.
 
-CALL_GRAPH             = NO
+CALL_GRAPH             = YES
 
 # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
 # will graphical hierarchy of all classes instead of a textual one.

cd systemc-2.0.1/src/systemc doxygen
これで、同じ位置に次のものが出来ます。
drwxr-xr-x  2 makoto  wheel  47104 Feb 14 14:35 html/
drwxr-xr-x  2 makoto  wheel  27136 Feb 14 14:35 latex/

出力を利用する

例えば、次のようにすると、上の方に選択肢が表示されるので、 それから中を見て行きます。
ttyp7:makoto@st4200 14:53:51/060214(...src/systemc)> mozilla file:`pwd`/html/index.html
一方
cd latex make vfxdvi refman.dvi
とすると、1000 ページもの印刷物が確認出来ます。 でも、あまり面白いものではないです。一応呼出関係のグラフが ときどき挿入されているのが救いです。多分上に示した設定をもう少し調整 すれば、も少し良いものが出来るでしょう。
ttyp7:makoto@st4200 15:16:43/060214(...systemc/latex)> find . -name \*eps |wc 201 201 6481
ソースの中に、次のように、euc-japan で書いておくと、これらが 処理されます。
/*! @file
    @brief XXXをYYYする関数群

    このファイルはXXXです。
    @author 作者
    @date   作成日, 履歴など
    $Revision: 1.2 $
*/
html の方は日本語がそのまま入りますが(と言っても charset は手動で設定)、 *.tex の日本語の方は、その中で既に文字が化けてしまっていたのですが、 これは
OUTPUT_LANGUAGE        = Japanese
とすると、正常に処理されます。

上に書いた話は、実は pkgsrc/mk/ghostscript.mk がたまたま残っていたから で、最近 pkgsrc の全体を update していると、うまく行かないようです。 そこで、

ttypa:makoto@st4200 17:47:02/060214(...devel/doxygen)> (cd ../../mk;cvs update -r 1.13 ghostscript.mk)
U ghostscript.mk
して見ます。doxygen の方も去年の 2005-10-13 日頃で充分な気がします。
ttypa:makoto@st4200 17:57:35/060214(...devel/doxygen)> cvs update -r 1.37 Makefile
U Makefile

1.4.5

実際には次のようにすれば、何とかなるはずです( 2006/02/14)。
                cd /usr/pkgsrc/devel/doxygen
   140  17:49   ( cd ../../mk ; cvs update -r 1.13 ghostscript.mk )
   150  17:57   cvs update -r 1.37 Makefile
===> Registering installation for doxygen-1.4.5nb1
doxygen-1.4.5nb1 requires installed package ghostscript-gnu-8.15
doxygen-1.4.5nb1 requires installed package graphviz-2.6nb3
doxygen-1.4.5nb1 requires installed package python23-2.3.5nb6
doxygen-1.4.5nb1 requires installed package teTeX-2.0.2nb1
===> Checking for work-directory references in doxygen-1.4.5nb1
===> Packaging doxygen-1.4.5nb1
===> Building binary package for doxygen-1.4.5nb1
Creating package /export/pkgsrc/packages/powerpc/All/doxygen-1.4.5nb1.tgz
Using SrcDir value of /usr/pkg
Registering depends: graphviz>=2.6nb3 python23>=2.3.5nb6 teTeX-[0-9]* 
  {ghostscript-esp>=6.01,ghostscript-gnu>=6.01,ghostscript-gnu-x11>=6.01,
   ghostscript>=6.01}.
ttypa:makoto@st4200 18:10:37/060214(...devel/doxygen)> 
関数の呼出関係 (call graph) を生成するには次の設定が必要 (Doxygen で Call Graph を出力する)
HAVE_DOT       = YES
CALL_GRAPH     = YES
SOURCE_BROWSER = YES

2007/04

graphviz が作れないため、doxygen が make 出来ない気がします。 4.99.3 の graphviz を pkg_add し、doxygen も 古い版 (2006-Q3)にして見ます。
   451  10:10   sudo mount /cdrom
   452  10:10   cd /cdrom/packages
   455  10:11   sudo pkg_add graphviz*
   468  10:15   cd /export/pkgsrc/devel/doxygen/
   470  10:15   cvs update -r pkgsrc-2006Q3
   471  10:16   make clean
   473  10:24   sudo make package clean
c++ -DHAVE_CONFIG_H -I. -I../.. -I../../lib/gvc -I../../lib/common -I../../lib/graph -I../../lib/cdt -I../../lib/pathplan -I/export/pkgsrc/graphics/graphviz/work.bologna/.buildlink/include -DNO_POSTSCRIPT_ALIAS=1 -DPNG_NO_ASSEMBLER_CODE -I/export/pkgsrc/graphics/graphviz/work.bologna/.buildlink/include/freetype2 -O2 -MT gv_perl.lo -MD -MP -MF .deps/gv_perl.Tpo -c gv_perl.cpp -fPIC -DPIC -o .libs/gv_perl.o gv_perl.cpp:719:20: error: EXTERN.h: No such file or directory gv_perl.cpp:720:18: error: perl.h: No such file or directory gv_perl.cpp:721:18: error: XSUB.h: No such file or directory gv_perl.cpp:729:28: error: patchlevel.h: No such file or directory