X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=remake.cpp;fp=remake.cpp;h=b36a3e76c95401913754f792577b4a3ed3813d20;hp=de68c4dc53c7d5b299a35dce41e631c16803aa72;hb=f6d5eeb99225f4160bfaa8411467fe88379a5211;hpb=6844beef9142975d1bf4a2b3fb72b93dfa3402dc 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) {