heptagon/compiler/myocamlbuild.ml

30 lines
1 KiB
OCaml
Raw Normal View History

2010-06-15 10:49:03 +02:00
open Ocamlbuild_plugin
open Ocamlbuild_plugin.Options
open Myocamlbuild_config
2010-06-15 10:49:03 +02:00
let df = function
| Before_options -> ocamlfind_before_options ()
2010-06-15 10:49:03 +02:00
| After_rules ->
ocamlfind_after_rules ();
2010-06-15 10:49:03 +02:00
(* Tell ocamlbuild about the camlp4 library. *)
ocaml_lib ~extern:true ~dir:(ocamlfind_query "camlp4") "camlp4";
2010-06-15 10:49:03 +02:00
(* Add preproc.cmo to the ocaml pre-processor when use_preproc is set *)
flag ["ocaml"; "pp"; "use_preproc"] (A "preproc.cmo");
2010-06-30 16:59:51 +02:00
2010-06-15 10:49:03 +02:00
(* Running ocamldep on ocaml code that is tagged with use_preproc will
require the cmo. Note that you only need this declaration when the
syntax extension is part of the sources to be compiled with
ocamlbuild. *)
dep ["ocaml"; "ocamldep"; "use_preproc"] ["preproc.cmo"];
2010-06-30 16:59:51 +02:00
flag ["ocaml"; "parser" ; "menhir" ; "use_menhir"] (S[A"--explain";
A"--table"]);
2010-06-29 11:18:50 +02:00
2011-04-18 15:47:25 +02:00
flag ["ocaml"; "compile" ] (S[A"-w"; A"Ae"; A"-warn-error"; A"PU"; A"-w"; A"-9"]);
2010-06-15 10:49:03 +02:00
| _ -> ()
let _ = dispatch df