summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRichard Geary <richardg.work@gmail.com>2013-08-05 02:36:14 (GMT)
committerRJ Ascani <rjascani@google.com>2021-08-02 20:45:16 (GMT)
commit48ed0bb4b433eba43583379336ba13b5489ab2aa (patch)
treee3703ca2f229c4bd4e990bd228bdf0f9026d2fea /doc
parent8fa4d05fea5140f80ff5f4629d19c6ce0d6f5cca (diff)
downloadNinja-48ed0bb4b433eba43583379336ba13b5489ab2aa.zip
Ninja-48ed0bb4b433eba43583379336ba13b5489ab2aa.tar.gz
Ninja-48ed0bb4b433eba43583379336ba13b5489ab2aa.tar.bz2
Set output mtime of phony edges to the latest inputs
This commit fixes issue #478. Observed: Real edges depending on a phony edge will not be marked as dirty or rebuilt if the phony's (real) inputs are updated. Expected: An edge should always be rebuilt if its inputs or transitive inputs are newer than the output's mtime. Change: Node::mtime_ was overloaded, 0 represented "does not exist". This change disambiguates it by adding Node::exists_. Then to fix the observed behaviour, Node::UpdatePhonyMtime was added to update the mtime if the node does not exist. Add tests BuildTest.PhonyUseCase# GraphTest.PhonyDepsMtimes. Unit tests will also test for always-dirty behaviour if a phony rule has no inputs.
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.asciidoc5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/manual.asciidoc b/doc/manual.asciidoc
index a5012b4..2b948b9 100644
--- a/doc/manual.asciidoc
+++ b/doc/manual.asciidoc
@@ -483,6 +483,11 @@ nothing, but phony rules are handled specially in that they aren't
printed when run, logged (see below), nor do they contribute to the
command count printed as part of the build process.
+When a `phony` target is used as an input to another build rule, the
+other build rule will, semantically, consider the inputs of the
+`phony` rule as its own. Therefore, `phony` rules can be used to group
+inputs, e.g. header files.
+
`phony` can also be used to create dummy targets for files which
may not exist at build time. If a phony build statement is written
without any dependencies, the target will be considered out of date if