summaryrefslogtreecommitdiff
path: root/myocamlbuild.ml
blob: 41b4cfc1c4748ca076226bbc97d33cf97e30f367 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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