X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;ds=inline;f=remake.cpp;h=b36a3e76c95401913754f792577b4a3ed3813d20;hb=cfbd6490c8b03b820375f79ff4d009ed2d0252c3;hp=de68c4dc53c7d5b299a35dce41e631c16803aa72;hpb=3dfc363bf140b2d385f48a53d05a8cdd72fc7033;p=tatoo.git
diff --git a/remake.cpp b/remake.cpp
index de68c4d..b36a3e7 100644
--- a/remake.cpp
+++ b/remake.cpp
@@ -184,6 +184,10 @@ parser.c parser.h: parser.y
yacc -d -o parser.c parser.y
@endverbatim
+\subsection sec-special-tgt Special targets
+
+Target .PHONY marks its prerequisites as being always obsolete.
+
\subsection sec-special-var Special variables
Variable .OPTIONS is handled specially. Its content enables some
@@ -343,7 +347,7 @@ https://github.com/apenwarr/redo for an implementation and some comprehensive do
\section sec-licensing Licensing
@author Guillaume Melquiond
-@version 0.10
+@version 0.11
@date 2012-2013
@copyright
This program is free software: you can redistribute it and/or modify
@@ -1663,6 +1667,17 @@ static void load_rule(std::istream &in, std::string const &first)
}
rule.script = buf.str();
+ // Register phony targets.
+ if (rule.targets.front() == ".PHONY")
+ {
+ for (string_list::const_iterator i = rule.deps.begin(),
+ i_end = rule.deps.end(); i != i_end; ++i)
+ {
+ status[*i].status = Todo;
+ }
+ return;
+ }
+
// Add generic rules to the correct set.
if (generic)
{