Commits

camlspotter committed 07a746e

widen the copy targets

Comments (0)

Files changed (1)

 let exts_of_sp = function
   | ".cmx" | ".cmo" -> [ ".spot"; ".cmt" ]
   | ".cmi" -> [ ".spit"; ".cmti"; ".cmt" ] (* Packed .cmi has no .spit but .spot *)
-  | ".ml" -> [ ".annot" ]
+  | ".ml" | ".mly" | ".mll" -> [ ".annot"; ".cmt" ]
+  | ".mli" -> [ ".cmti" ]
   | _ -> assert false
 
-let find_installed_cms tbl package =
+let find_installed tbl package =
   eprintf "Finding cms of %s...\n%!" (show_dest package);
   let dest_dir = match package with 
     | Package "ocaml" -> OCaml.where 
     if path#base = "site-lib" && package = Package "ocaml" then 
       Find.prune ()
     else match Filename.split_extension path#base with
-    | body, (".cmx" | ".cmo" | ".cmi" as ext) -> 
+    | body, (".cmx" | ".cmo" | ".cmi" | ".ml" | ".mli" | ".mly" | ".mll" as ext) -> 
         if verbose then Printf.eprintf "found %s\n" path#path;
         Hashtbl.add tbl (body, ext) (package, path#path)
     | _ -> ());
   | `Some dests -> dests
   | `All -> List.map (fun x -> Package x) OCamlFind.packages
 
-let installed_cms = 
+let installed_files = 
   let tbl = Hashtbl.create 107 in
-  List.iter (fun package -> find_installed_cms tbl package) dests;
+  List.iter (fun package -> find_installed tbl package) dests;
   tbl
 
 (* For each installed *.cm* file, we try to find the same file in the current directory,
 
   Unix.Find.find ["."] ~f:(fun path ->
     match Filename.split_extension path#base with
-    | body, (".cmx" | ".cmo" | ".cmi" | ".ml" as ext) -> 
+    | body, (".cmx" | ".cmo" | ".cmi" | ".ml" | ".mly" | ".mll" | ".mli" as ext) -> 
         List.map (fun ext -> path#dir ^/ body ^ ext) (exts_of_sp ext)
         |> List.find_all Sys.file_exists 
         |> List.iter (fun spotspit ->
-          Hashtbl.find_all installed_cms (body, ext) 
+          Hashtbl.find_all installed_files (body, ext) 
           |> List.iter (fun (_package, p) -> 
             match cmp p path#path with
             | `Different | `Error -> ()
   Hashtbl.iter (fun _ (package, path) -> 
     if not (Hashset.mem copied path) then
       Printf.eprintf "No binannot file found %s (%s)\n" path (show_dest package)) 
-    installed_cms
+    installed_files