summaryrefslogtreecommitdiff
path: root/myocamlbuild.ml
diff options
context:
space:
mode:
Diffstat (limited to 'myocamlbuild.ml')
-rw-r--r--myocamlbuild.ml17
1 files changed, 17 insertions, 0 deletions
diff --git a/myocamlbuild.ml b/myocamlbuild.ml
new file mode 100644
index 0000000..41b4cfc
--- /dev/null
+++ b/myocamlbuild.ml
@@ -0,0 +1,17 @@
+open Ocamlbuild_plugin;;
+dispatch begin function
+| After_rules ->
+ (* declare the tags "use_Cparser" and "include_Cparser" *)
+ ocaml_lib "cfrontend/Cparser";
+
+ (* force linking of libCparser.a when use_Cparser is set *)
+ flag ["link"; "ocaml"; "native"; "use_Cparser"]
+ (S[A"cfrontend/libCparser.a"]);
+ flag ["link"; "ocaml"; "byte"; "use_Cparser"]
+ (S[A"-custom"; A"cfrontend/libCparser.a"]);
+
+ (* make sure libCparser.a is up to date *)
+ dep ["link"; "ocaml"; "use_Cparser"] ["cfrontend/libCparser.a"];
+
+| _ -> ()
+end