doxygenとの連携

http://article.gmane.org/gmane.comp.programming.tools.scons.devel/116

にあった、

# Build the doxygen documentation
target = "generated/html/index.html"
source = Split('''
    doxygen.cfg
    ''')
# Manually specify the doxygen dependencies. The right way to do this would
# to write a scanner that can read the doxygen.cfg file and automatically
# figure out the dependencies
depends = Split('''
    #idl/file1.idl
    #idl/file2.idl
    ''')
env.Depends(target, depends)
commands = [
    'doxygen $SOURCES',
    ]

node = env.Command(target, source, commands)
env.Default(node)

がよさげです。ただ、これだとソースの変更と doxygen コマンド発行の間に依存関係が無いため、SCons に doxygen 起動タイミングを検出させることができません。ですが、全てのソースと doxygen コマンドに依存関係を作ると、処理に時間がかかりそうです。上記のコードだと、単に doxygen コマンド発行をデフォルトのターゲットとし、ユーザーがほとんどの場合、doxygen コマンドを発行するようにしています。たしかに、それもいいやり方かもしれません。また、doxygen コマンドを単に毎回発行するという手もあると思います。