summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-09-22 16:04:03 (GMT)
committerPeter Collingbourne <peter@pcc.me.uk>2011-10-15 19:23:50 (GMT)
commit7cf2bdffe2a95ea5e30e9c3166ef4398add8e6b9 (patch)
tree2b8cd622a0fa858beb0b91da121255a82274272b /doc
parent07c1f9b14b5f7071a5def7d09414ec852a4372ef (diff)
downloadNinja-7cf2bdffe2a95ea5e30e9c3166ef4398add8e6b9.zip
Ninja-7cf2bdffe2a95ea5e30e9c3166ef4398add8e6b9.tar.gz
Ninja-7cf2bdffe2a95ea5e30e9c3166ef4398add8e6b9.tar.bz2
Implement generator rules
Introduce a rule attribute "generator" which, if present, specifies that this rule is used to re-invoke the generator program. Files built using generator rules are treated specially in two ways: firstly, they will not be rebuilt if the command line changes; and secondly, they are not cleaned by default. A command line flag "-g" is introduced for the clean tool, which causes it to remove generator files. Fixes issue #102.
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.asciidoc26
1 files changed, 16 insertions, 10 deletions
diff --git a/doc/manual.asciidoc b/doc/manual.asciidoc
index ed44bd2..7e7063b 100644
--- a/doc/manual.asciidoc
+++ b/doc/manual.asciidoc
@@ -382,16 +382,16 @@ than the _depth_ mode. It returns non-zero if an error occurs.
one. It can be used to know which rule name to pass to
+ninja -t targets rule _name_+.
-`clean`:: remove built files. If used like this +ninja -t clean+ it
-removes all the built files. If used like this
-+ninja -t clean _targets..._+ or like this
-+ninja -t clean target _targets..._+ it removes the given targets and
-recursively all files built for it. If used like this
-+ninja -t clean rule _rules_+ it removes all files built using the given
-rules. The depfiles are not removed. Files created but not referenced in
-the graph are not removed. This tool takes in account the +-v+ and the
-+-n+ options (note that +-n+ implies +-v+). It returns non-zero if an
-error occurs.
+`clean`:: remove built files. If used like this +ninja -t clean+ it removes
+all the built files, except for those created by the generator. If used like
+this +ninja -t clean -g+ it also removes built files created by the generator.
+If used like this +ninja -t clean _targets..._+ or like this +ninja -t clean
+target _targets..._+ it removes the given targets and recursively all files
+built for it. If used like this +ninja -t clean rule _rules_+ it removes
+all files built using the given rules. The depfiles are not removed. Files
+created but not referenced in the graph are not removed. This tool takes
+in account the +-v+ and the +-n+ options (note that +-n+ implies +-v+).
+It returns non-zero if an error occurs.
Ninja file reference
--------------------
@@ -464,6 +464,12 @@ aborting due to a missing input.
the full command or its description; if a command fails, the full command
line will always be printed before the command's output.
+`generator`:: if present, specifies that this rule is used to re-invoke
+ the generator program. Files built using `generator` rules are
+ treated specially in two ways: firstly, they will not be rebuilt
+ if the command line changes; and secondly, they are not cleaned
+ by default.
+
Additionally, the special `$in` and `$out` variables expand to the
space-separated list of files provided to the `build` line referencing
this `rule`.