ocamlocamlbuildocamlfind

OCamlbuild recursively build dependecies


I’m building a project that uses OCamlbuild as its build system. This project also requires a library, which also uses OCamlbuild. This library comes with .mlpack, _tags, and myocamlbuild.ml files. I have included the library into my project as a git submodule in the path lib/mylib starting from the project’s root.

I’d like to tell OCamlbuild to recursively compile the library, as I would to with a make -C lib/mylib in a Makefile.

How can I achieve that?

Thanks.


Solution

  • An answer is described in Working on dependent projects with OCamlbuild.
    Basically, add <lib/mylib>: include to _tags and import the library myocamlbuild.ml. It does seem a bit wobbly.

    Or use Dune.