+*)
+(* FG: new sorting algorithm ************************************************)
+
+ let rec make_aux root opts ok deps =
+ List.fold_left (make_one root opts) ok deps
+
+ and make_one root opts ok what =
+ let lo, _, ct, cc, cd = opts in
+ let t, deps, froot, tgt = what in
+ let str = F.string_of_source_object t in
+ let map (okd, okt) d =
+ let (_, _, _, tgtd) as whatd = (Hashtbl.find cd d) in
+ let r = make_one root opts okd whatd in
+ r, okt && modified_before_t_t opts tgtd tgt
+ in
+ time_stamp ("L : processing " ^ str);
+ try
+ let r = Hashtbl.find cc t in
+ time_stamp ("L : " ^ string_of_bool r ^ " " ^ str);
+ ok && r
+(* say "already built" *)
+ with Not_found ->
+ let okd, okt = List.fold_left map (true, modified_before_s_t opts t tgt) deps in
+ let res =
+ if okd then
+ if okt then true else
+ match froot with
+ | Some froot when froot = root ->
+ if is_not_ro opts what then begin
+ Hashtbl.remove ct tgt;
+ Hashtbl.add ct tgt None;
+ time_stamp ("L : BUILDING " ^ str);
+ let res = F.build lo t in
+ time_stamp ("L : DONE " ^ str); res
+ end else begin
+ HLog.warn("Read only baseuri for: "^ str); false
+ end
+ | Some froot -> make froot [t]
+ | None ->
+ HLog.error ("No root for: " ^ str); false
+ else false
+ in
+ time_stamp ("L : " ^ string_of_bool res ^ " " ^ str);
+ Hashtbl.add cc t res; ok && res
+
+(****************************************************************************)