- | Before_rules ->
- Options.ocamlc := ocamlfind (A"ocamlc");
- Options.ocamlopt := ocamlfind (A"ocamlopt");
- Options.ocamldep := ocamlfind (A"ocamldep");
- Options.ocamldoc := ocamlfind (A"ocamldoc");
- Options.ocamlmktop := ocamlfind (A"ocamlmktop");
- dep [ "extension:ml" ]
- (List.map (fun s -> "include/" ^ s )
- (Array.to_list (Pathname.readdir "include")));
- flag [ "ocaml"; "link" ] (A"-linkpkg")
+ | Before_rules -> ()
+ | After_rules ->
+ set_flags [["ocaml";"compile"]; ["ocaml";"ocamldep"] ] macro_flags;
+ pflag [ "ocaml"; "compile" ] "warning" (fun s -> (S[ A"-w"; A s]));
+ flag [ "ocaml"; "compile"; "debug" ] (S[ A"-g"; A"-ppopt"; A"-DDEBUG"]);
+ flag [ "ocaml"; "link"; "debug" ] (A"-g");
+ flag [ "ocaml"; "compile"; "profile"] (S[A"-ppopt"; A"-DPROFILE"]);
+ flag [ "ocaml"; "compile"; "profile"; "native"] (A"-p");
+ flag [ "ocaml"; "link"; "profile"; "native"] (A"-p");
+ pflag [ "ocaml"; "compile"; "native" ] "inline" (fun i -> (S[ A"-inline"; A i ]));
+ pflag [ "ocaml"; "compile" ] "unsafe" (fun s -> (if s = "true" then S[A"-ppopt";A "-unsafe"] else N));
+
+
+ rule "Java compilation"
+ ~prod:"%.class"
+ ~dep:"%.java"
+ begin fun env _build ->
+ let java = env "%.java" in
+ let tags = tags_of_pathname java ++ "compile" in
+ Cmd( S[ A"javac" ; P java; T tags ])
+ end