summaryrefslogtreecommitdiffstats
path: root/manual.asciidoc
diff options
context:
space:
mode:
authorNicolas Despres <nicolas.despres@gmail.com>2011-04-10 11:32:24 (GMT)
committerNicolas Despres <nicolas.despres@gmail.com>2011-04-26 11:23:04 (GMT)
commit3ad977241b24ea8077073f1f3feecab7b8dc0b55 (patch)
tree270bedc93683bb41e97a28b348eb70feafa297ec /manual.asciidoc
parentf10afb9d402b33710bd0b93f0c9c42f438347171 (diff)
downloadNinja-3ad977241b24ea8077073f1f3feecab7b8dc0b55.zip
Ninja-3ad977241b24ea8077073f1f3feecab7b8dc0b55.tar.gz
Ninja-3ad977241b24ea8077073f1f3feecab7b8dc0b55.tar.bz2
Add the 'targets' tool.
This tool list targets by depth or by rule. It can be useful: - for shell completion script ; - to know what are the primary targets: ninja -t targets depth 1 ; - to know targets that are linked: ninja -t rule link ; - when debugging. It works by first listing the root nodes and then following the input nodes of their in edge.
Diffstat (limited to 'manual.asciidoc')
-rw-r--r--manual.asciidoc12
1 files changed, 12 insertions, 0 deletions
diff --git a/manual.asciidoc b/manual.asciidoc
index 80dfc50..8bfc2e7 100644
--- a/manual.asciidoc
+++ b/manual.asciidoc
@@ -313,6 +313,18 @@ graph layout tool. Use it like: +ninja -t graph _target_ | dot -Tpng
-ograph.png /dev/stdin+ . In the Ninja source tree, `ninja graph`
generates an image for Ninja itself.
+`targets`:: output a list of targets either by rule or by depth. If used
+like this +ninja -t targets rule _name_+ it prints the list of targets
+using the given rule to be built. If no rule is given, it prints the source
+files (the leaf of the graph). If used like this
++ninja -t targets depth _digit_+ it
+prints the list of targets in a depth-first manner starting by the root
+targets (the ones with no outputs). Indentation is used to mark dependencies.
+If the depth is zero it prints all targets. If no arguments are provided
++ninja -t targets depth 1+ is assumed. In this mode targets may be listed
+several times. If used like this +ninja -t targets all+ it
+prints all the targets available without indentation and it is way faster
+than the _depth_ mode. It returns non-zero if an error occurs.
Ninja file reference
--------------------