anchor.diff:  
               let start = System.DateTime.Now
               let db = Storage.openDb options.ProjectRoot logger
  -            let ctx = {Ordinal = 0; TaskPool = pool; Throttler = throttler; Options = options; Rules = rules; Logger = logger; RootLogger = logger; Db = db }
  +
  +            let ctx = {
  +                Ordinal = 0
  +                TaskPool = pool; Throttler = throttler
  +                Options = options; Rules = rules
  +                Logger = logger; RootLogger = logger; Db = db
  +                NeedRebuild = fun _ -> false
  +                }
  +            // TODO wrap more elegantly
  +            let rec get_changed_deps = Common.memoize (getDepsImpl ctx (fun x -> get_changed_deps x)) in
  +
  +            let check_rebuild target =
  +                get_changed_deps >>
  +                function
  +                | [] -> false, ""
  +                | DepState.Other reason::_            -> true, reason
  +                | DepState.Depends (t,_) ::_          -> true, "Depends on target " + (Target.getFullName t)
  +                | DepState.FilesChanged (file::_) ::_ -> true, "File(s) changed " + file
  +                | _ -> true, "Some reason"
  +                >>
  +                function
  +                | false, _ -> false
  +                | true, reason ->
  +                    do ctx.Logger.Log Info "Rebuild %A: %s" (getShortname target) reason
  +                    true
  +                <| target
  +
  +            let ctx = {ctx with NeedRebuild = check_rebuild}
   
               logger.Log Info "Options: %A" options
   
  
positive.code:         /// Gets all changed dependencies
          /// </summary>
          /// <param name="ctx"></param>
          /// <param name="getDeps">gets state for nested dependency</param>
          /// <param name="tgt"></param>
          let getDepsImpl ctx getDeps tgt =
  
              let lastBuild = (fun ch -> GetResult(tgt, ch)) |> ctx.Db.PostAndReply
              let dep_state = getDepState (getVar ctx) (toFileList ctx.Options.ProjectRoot) (getDeps)
  
              match lastBuild with
              | Some {BuildResult.Depends = []} ->
  
negative.code:         Logger: ILogger
          RootLogger: ILogger
          Ordinal: int
          NeedRebuild: Target -> bool
      }
  
      /// Main type.
  