From 2ab66de40998fe61a834dcbd68aa8c1067c5fcc8 Mon Sep 17 00:00:00 2001 From: Nicolas Despres Date: Mon, 18 Apr 2011 21:31:13 +0200 Subject: [PATCH] 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. --- build.ninja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.7.4