I have written a myocamlbuild.ml
after this manual containing the following code in order to not to have to enter in command line some flags each time compiling a test written with alcotest
like ocamlbuild -use-ocamlfind -package alcotest test_foo.native
open Ocamlbuild_plugin
let () =
dispatch & function
| Before_rules ->
pflag ["test_alcotest"] "package" & fun name -> S [A "-use-ocamlfind"; A "-package"; A name]
| _ -> ()
I imagined the command ocamlbuild test_foo.native
would read the tag I defined in _tags
file as
<test_*.ml>: test_alcotest, package(alcotest)
and would call ocamlc.opt -c -o -use-ocamlfind -package alcotest test_foo.ml
, but it wouldn't; instead it called ocamldep.opt -use-ocamlfind -package alcotest -pp '-use-ocamlfind -package alcotest' -modules test_foo.ml > test_foo.ml.depends
how can I change that?