summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Despres <nicolas.despres@gmail.com>2011-04-18 19:31:13 (GMT)
committerNicolas Despres <nicolas.despres@gmail.com>2011-04-18 19:57:56 (GMT)
commit2ab66de40998fe61a834dcbd68aa8c1067c5fcc8 (patch)
tree011172cee4458906ff46f21a714fc806b84159fb
parent99e0560bdc85fa62273ed82645fef64b3c20c6e6 (diff)
downloadNinja-2ab66de40998fe61a834dcbd68aa8c1067c5fcc8.zip
Ninja-2ab66de40998fe61a834dcbd68aa8c1067c5fcc8.tar.gz
Ninja-2ab66de40998fe61a834dcbd68aa8c1067c5fcc8.tar.bz2
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.
-rw-r--r--build.ninja2
1 files changed, 1 insertions, 1 deletions
diff --git a/build.ninja b/build.ninja
index 23c3291..1f19387 100644
--- a/build.ninja
+++ b/build.ninja
@@ -102,4 +102,4 @@ rule doxygen_mainpage
build $builddir/doxygen_mainpage: doxygen_mainpage \
README HACKING COPYING | $doxygen_mainpage_generator
-build doxygen: doxygen doxygen.config || $builddir/doxygen_mainpage
+build doxygen: doxygen doxygen.config $builddir/doxygen_mainpage