title: How to use Menhir error messages generation via OCamlbuild?
body: <p>I am using the <code>--compile-errors</code> functionality of <code>menhir</code> and I'm quite happy with it. I'm also using <code>ocamlbuild</code> to manage the compilation of my project. Since the project is quite basic, the build infrastructure has remained trivial so far.</p>
  
  <p>I have a single <code>_tags</code> file and a simple <code>Makefile</code> at the root of the project. I don't have a <code>myocamlbuild.ml</code> file yet. The <code>_tags</code> file contains just one line:</p>
  
  <pre><code>&lt;src/*&gt;: package(ppx_deriving.std)
  </code></pre>
  
  <p>The relevant part of the Makefile is</p>
  
  <pre><code>all: src/ParsingErrors.ml
      ocamlbuild $(OPTIONS) src/Main.native
  
  src/ParsingErrors.ml: src/Handcrafted.messages src/Parser.mly
      menhir --compile-errors src/Handcrafted.messages src/Parser.mly &gt; src/ParsingErrors.ml
  
  OPTIONS = -j 4 -use-menhir -use-ocamlfind -yaccflag --table -pkgs menhirLib,str,unix
  </code></pre>
  
  <p>OCamlbuild and Menhir are usually well integrated, but <code>--compile-errors</code> seems to be a fairly new functionality. My setup is not ideal because I dislike having an automatically generated file, <code>src/ParsingErrors.ml</code>, in my source directory instead of the build directory. What would be the best way to explain to OCamlbuild that I want Menhir to build this error messages file? Changing the naming convention of my files (into <code>src/Parser.messages</code> and <code>src/Parser.ml</code>, for example) does not bother me if it simplifies things.</p>
  
  <p>NB: although I have <code>myocamlbuild.ml</code> files in other projects, I copied them from online sources. I find them hard to decipher and I don't really understand how to write these things.</p>