Dear all,
OCaml's parser generator, ocamlyacc, produces two files simultaneously.
For example, the command
ocamlyacc parsermly
will produce both parser.ml (the code of the parser) and parser.mli (the
interface of the parsing module, descrbing which symbols it exports).
I am wondering what's the best way to let make know about this.
From what I understand, a rule like
parser.mli parser.ml: parser.mly
ocaplyacc $<
does nos say exactly this but is rather an abbreviation for
parser.mli: parser.mly
ocamlyacc $<
parser.ml: parser.mly
ocamlyacc $<
which is not what I'd like to express
I have been told that one way to make things work could be the two
following rules:
parser.mli parser.ml: parser.mly
ocamlyacc $<
parser.mli: parser.ml
Is this the commonly used way to achieve the expected result?
I find it a bit tricky because "parser.mli: parser.ml" looks like a hack
to me, there is no real dependency.
Even if that is what is commonly used, I am wondering how this would
generalize to a command that would produce n files where n>2.
Many thanks for any comment,
Sébastien.