If your project has no external dependency and has foo.ml as its main entry point, you can compile a bytecode version with
foo.ml
ocamlbuild foo.byte
To get a native executable, run
ocamlbuild foo.native