- List.iter
- (fun ma_file ->
- let deps = Hashtbl.find_all include_deps ma_file in
- let deps = List.fast_sort Pervasives.compare deps in
- let deps = HExtlib.list_uniq deps in
- let deps = ma_file :: deps in
- let baseuri = Hashtbl.find baseuri_of ma_file in
- let moo = LibraryMisc.obj_file_of_baseuri ~baseuri ~writable:false in
- Printf.printf "%s: %s\n" moo (String.concat " " deps);
- Printf.printf "%s: %s\n" (Pcre.replace ~pat:"ma$" ~templ:"mo" ma_file) moo)
- (Helm_registry.get_list Helm_registry.string "matita.args")
-
+ if !do_dot then
+ begin
+ let fmt = Format.formatter_of_out_channel stdout in
+ GraphvizPp.Dot.header (* ~graph_attrs:["rankdir","LR"] *) fmt;
+ List.iter
+ (fun ma_file ->
+ let deps = Hashtbl.find_all include_deps_dot ma_file in
+ let deps =
+ HExtlib.filter_map
+ (fun u ->
+ try Some (Hashtbl.find baseuri_of_inv u)
+ with Not_found -> None)
+ deps
+ in
+ let deps = List.fast_sort Pervasives.compare deps in
+ let deps = HExtlib.list_uniq deps in
+ GraphvizPp.Dot.node ma_file fmt;
+ List.iter (fun dep -> GraphvizPp.Dot.edge ma_file dep fmt) deps)
+ ma_files;
+ GraphvizPp.Dot.trailer fmt;
+ close_out stdout
+ end
+ else
+ begin
+ List.iter
+ (fun ma_file ->
+ let deps = Hashtbl.find_all include_deps ma_file in
+ let deps = List.fast_sort Pervasives.compare deps in
+ let deps = HExtlib.list_uniq deps in
+ let deps = ma_file :: deps in
+ let baseuri = Hashtbl.find baseuri_of ma_file in
+ let moo = obj_file_of_baseuri true baseuri in
+ Printf.printf "%s: %s\n%s: %s\n%s: %s\n" moo (String.concat " " deps)
+ (Filename.basename (Pcre.replace ~pat:"ma$" ~templ:"mo" ma_file)) moo
+ (Pcre.replace ~pat:"ma$" ~templ:"mo" ma_file) moo)
+ ma_files
+ end
+;;