summaryrefslogtreecommitdiffstats
path: root/build.ninja
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2010-11-09 09:15:36 (GMT)
committerEvan Martin <martine@danga.com>2010-11-09 09:15:36 (GMT)
commit8c5daeea59717e54a9122390efad53700a4c6e90 (patch)
tree1fb1c07b924a7f5dcac3279092fbe7f67beaf2f9 /build.ninja
parent51ef012a84de53b3a9ffd4cef6153b11f4be39f9 (diff)
downloadNinja-8c5daeea59717e54a9122390efad53700a4c6e90.zip
Ninja-8c5daeea59717e54a9122390efad53700a4c6e90.tar.gz
Ninja-8c5daeea59717e54a9122390efad53700a4c6e90.tar.bz2
add simple graphing
Diffstat (limited to 'build.ninja')
-rw-r--r--build.ninja11
1 files changed, 11 insertions, 0 deletions
diff --git a/build.ninja b/build.ninja
index 1499d21..c4d33f9 100644
--- a/build.ninja
+++ b/build.ninja
@@ -39,3 +39,14 @@ build @parsers_test.o: cxx parsers_test.cc
build ninja_test: link @ninja_test.o @parsers_test.o @ninja.a
ldflags = -lgtest -lgtest_main -lpthread
+
+# Generate a graph of the dependency tree (including the
+# graph generation itself in the resulting tree).
+graph_targets = ninja ninja_test graph.png
+rule gendot
+ command = ./ninja -g $graph_targets > $out
+rule gengraph
+ command = dot -Tpng $in > $out
+
+build @graph.dot: gendot ninja build.ninja
+build graph.png: gengraph @graph.dot