- if !debug land 2 > 0 then Printf.eprintf " compute file: %s\n" fname;
- let vdeps = fname :: vdeps in
- List.iter (redundant vdeps fname file.ddeps) file.ddeps;
- let rdeps = compute_from_ddeps vdeps file.ddeps in
- Hashtbl.replace graph fname {file with rdeps = Some rdeps};
- rdeps
+ if !debug land 2 > 0 then Printf.printf " (%u) compute object: %s\n%!" (List.length vdeps) fname;
+ if !debug land 2 > 0 then Printf.printf " ddeps: %s\n%!" (String.concat " " file.ddeps);
+ if !debug land 8 > 0 then Printf.printf " vdeps: %s\n%!" (String.concat " " vdeps);
+ if List.mem fname vdeps then begin
+ if !show_check then Printf.printf "circular: %s\n%!" (String.concat " " vdeps);
+ StringSet.empty
+ end else begin
+ let vdeps = fname :: vdeps in
+ List.iter (redundant vdeps fname file.ddeps) file.ddeps;
+ let rdeps = compute_from_ddeps vdeps file.ddeps in
+ Hashtbl.replace graph fname {file with rdeps = Some rdeps};
+ rdeps
+ end