Touching README and co triggers rebuild of doxygen.
Before the main page was an order-only dependency of the doxygen target.
Thus, modification in the README did not triggers rebuild of the doxygen
target as it ought to be.
We have several ways to fix this issue:
1) Make the '$builddir/doxygen_mainpage' target an explicit dependency:
build $builddir/doxygen_mainpage: doxygen_mainpage \
README HACKING COPYING | $doxygen_mainpage_generator
build doxygen: doxygen doxygen.config $builddir/doxygen_mainpage
2) Duplicate the explicit dependencies of the '$builddir/doxygen_mainpage'
target as implicit dependencies of the 'doxygen' target and keep the
'$builddir/doxygen_mainpage' target as an order-only dependency:
build $builddir/doxygen_mainpage: doxygen_mainpage \
README HACKING COPYING | $doxygen_mainpage_generator
build doxygen: doxygen doxygen.config \
| README HACKING COPYING \
|| $builddir/doxygen_mainpage
I chose the first option since the doxygen executable only cares about its
first argument. But it would not be the case for all commands. So I
think introducing "slice" support for the $in and $out variables would be
great. This way I could rewrite the 'doxygen' rule this way:
rule doxygen
command = doxygen $in[0]
description = DOXYGEN $in[0]
Note that using variables to avoid duplication does not work since the
three files are seen as a single one:
doxygen_deps = README HACKING COPYING
build $builddir/doxygen_mainpage: doxygen_mainpage \
$doxygen_deps | $doxygen_mainpage_generator
build doxygen: doxygen doxygen.config \
| $doxygen_deps \
|| $builddir/doxygen_mainpage
Maybe Ninja's philosophy expects the generators to generate the second
option.