ocamlocamlbuildocamlfindutopocaml-toplevel

How to build a custom utop-based toplevel with ocamlbuild?


I want to create a utop-based toplevel for my project, which is built by ocamlbuild.

However, ocamlbuild supports only mktoplevel, built from *.mltop. It doesn't mention utop anywhere in the docs.

Also, the utop manual explains just toplevel creation by jbuilder and doesn't even mention ocamlbuild. It also explains building via ocamlfind, but strongly discourages that approach.

So how should I create my utop-based toplevel?

Or, is this a totally wrong approach and I should do something different to get my utop-based toplevel. If so, what is the recommended way?


Solution

  • The custom-utop example from the utop sources used to be built with ocamlbuild and was later to jbuilder. See this older version for an example.