From: Kim Nguyễn Date: Mon, 3 Mar 2014 16:05:01 +0000 (+0100) Subject: Update to remake version 0.11 (support for .PHONY targets). X-Git-Tag: v0.1^0 X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=commitdiff_plain;h=f6d5eeb99225f4160bfaa8411467fe88379a5211;hp=6844beef9142975d1bf4a2b3fb72b93dfa3402dc Update to remake version 0.11 (support for .PHONY targets). --- 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) {