ligo/myocamlbuild.ml
Jeremie Dimino f255c375a0 113.24.00
2016-01-12 17:20:06 +00:00

30 lines
738 B
OCaml

(* OASIS_START *)
(* OASIS_STOP *)
# 3 "myocamlbuild.ml"
(* Temporary hacks *)
let js_hacks = function
| After_rules ->
rule "Generate a cmxs from a cmxa"
~dep:"%.cmxa"
~prod:"%.cmxs"
~insert:`top
(fun env _ ->
Cmd (S [ !Options.ocamlopt
; A "-shared"
; A "-linkall"
; A "-I"; A (Pathname.dirname (env "%"))
; A (env "%.cmxa")
; A "-o"
; A (env "%.cmxs")
]));
(* Pass -predicates to ocamldep *)
pflag ["ocaml"; "ocamldep"] "predicate" (fun s -> S [A "-predicates"; A s])
| _ -> ()
let () =
Ocamlbuild_plugin.dispatch (fun hook ->
js_hacks hook;
dispatch_default hook)