[Omake] Changes in MenhirMulti or OCamlGeneratedFiles

Aleksey Nogin nogin at metaprl.org
Thu Mar 22 22:47:27 PDT 2007


On 22.03.2007 17:37, Nick Kidd wrote:

>>> I recently upgraded to omake 0.9.8.1 via GODI. That all worked fine;
>>> however, omake now fails to build my project. It is detecting a
>>> deadlock on a generated file 'parser.mli'. Was there a change in
>>> detecting dependencies or in the MenhirMulti rules?
>>
>> Yes, Menhir dependency scanning had a bug, which was fixed.
> 
> Good news! I didn't see this in the changelog. Is it documented
> anywhere? 

The problem was that --raw-depend would be used inappropriately when
OCAMLDEP_MODULES is disabled. This was fixed in rev. 10000 and was
discussed in mailing list thread at
http://lists.metaprl.org/pipermail/omake/2007-February/001465.html

> The Menhir package that comes with GODI has examples under
> godi/share/doc/menhir/demos. The OMake commands they define take an
> extra "flags" argument (i.e., MenhirMulti(target,sources,flags)). I
> think this is easier than using the global MENHIR_FLAGS variable, namely
> because of the --tokens-only and --external-tokens flags.

Note that you do not have to worry about "restoring" the value of the
MENHIR_FLAGS variable - this is what the "section" scoping is for!

The example OMakefile that you gave in an earlier email can probably be
rewritten to include something like

MENHIR_FLAGS += --comment

section
   MENHIR_FLAGS += --only-tokens
   MenhirMulti(tokens, tokens.mly ir_tokens.mly)

OCamlGeneratedFiles(tokens.mli tokens.ml)

section
   MENHIR_FLAGS += --external-tokens Tokens
   MenhirMulti(parser, ir_tokens.mly tokens.mly ir_parser.mly parser.mly)

OCamlGeneratedFiles(parser.mli parser.ml ir_lexer.ml)

> Would it be possible to add this capability to OCaml.om?

Possible - yes, of course. Desirable - not so sure. We are planning to
allow functions to take optional ("keyword") arguments in future
versions of OMake (this is already implemented on the 0.9.9.x branch).
Then it might become reasonable to allow an optional flags argument.

Aleksey


More information about the Omake mailing list