let ocamlopt_p tags deps out =
let dirnames = List.union [] (List.map Pathname.dirname deps) in
let include_flags = List.fold_right ocaml_add_include_flag dirnames [] in
let mli = Pathname.update_extensions "mli" out in
let cmd =
S [!Options.ocamlopt; A"-pack"; forpack_flags out tags; T tags;
S include_flags; atomize_paths deps;
A"-o"; Px out] in
if Pathname.exists mli then Cmd cmd
else
let rm = S[A"rm"; A"-f"; P mli] in
Cmd(S[A"touch"; P mli; Sh" ; if "; cmd; Sh" ; then "; rm; Sh" ; else ";
rm; Sh" ; exit 1; fi"])