As far as I know, no, but you can easily start compiling from emacs.
If you use the Mx compile command ( Cc Cc using tuareg mode ), the compilation is done in emacs compilation mode, which is nice to work with. In particular, it allows you to jump directly to erroneous positions in the code in case of a compilation error ( Mx goto-next-error or "Cx`").
With the compilation command, you select the command (shell) to start compilation. You can directly call the ocamlc -c foo.ml compiler (usually ocamlc -c foo.ml ) or use ocamlfind to facilitate compilation using external libraries and even make or ocamlbuild to automate most compilations for you. As a rule, if you have a small project using different source files, with the main.ml file, ocamlbuild main.byte will perform the task of creating an executable file from it.
Edit: Of course, you could call the system command from the top level using the Sys.command function. But I do not see the point.
source share