- (* Recompile the jobs file. *)
- let file = get_jobs_filename () in
- let cmo_file = sprintf "%s/jobs.cmo" jobsdir in
- let cmd = sprintf "ocamlfind ocamlc -I +camlp4 -I %s -package unix,camlp4.lib -pp 'camlp4o %s/pa_when.cmo' -c %s -o %s"
- !libdir !libdir file cmo_file in
- if Sys.command cmd <> 0 then (
- eprintf "whenjobs: could not compile jobs script, see earlier error messages\n";
- eprintf "compile command was:\n%s\n" cmd;
- exit 1
- );
+ (* Recompile the jobs file(s). *)
+ let files = get_multijobs_filenames () in
+ List.iter (
+ fun file ->
+ let cmd = sprintf "%s c -I +camlp4 -I %s -package unix,camlp4.lib -pp 'camlp4o %s/pa_when.cmo' -c %s"
+ Config.ocamlfind !libdir !libdir file in
+ if Sys.command cmd <> 0 then (
+ eprintf "whenjobs: %s: could not compile jobs script, see earlier errors\n"
+ file;
+ eprintf "compile command was:\n%s\n" cmd;
+ exit 1
+ )
+ ) files;
+
+ let cmo_files = List.map (
+ fun file ->
+ let n = String.length file in
+ if n < 4 then assert false;
+ String.sub file 0 (n-3) ^ ".cmo"
+ ) files in