X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=myocamlbuild.ml;h=0ea5ff0097df2a0e8d24edecff73593f1e46cd77;hp=d198faa9dea745b0d9a7ee412c289b60b40611dc;hb=9b3611f8b650edf4183169a9c2c4317e13be536d;hpb=f749a3e33d759fddef63a69e54ff1336411d5e16 diff --git a/myocamlbuild.ml b/myocamlbuild.ml index d198faa..0ea5ff0 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -26,7 +26,8 @@ let macro_flags = [ let () = dispatch begin function - | Before_rules -> + | 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"]); @@ -37,5 +38,14 @@ let () = dispatch begin 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 | _ -> () end