Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
OCamlMakefile, menhir and its --infer option
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-08-06 (11:16)
From: ChoJin <chojin@l...>
Subject: OCamlMakefile, menhir and its --infer option

I have an issue while using OCamlMakefile, menhir and its --infer  

I have something along those lines:

OCAMLYACC = menhir

	parser/ \
	parser/parser.mly \
	parser/lexer.mll \


like this, everything is fine. But then, if I start using menhir  
features such as %inline or the standard library, menhir advises to  
use the --infer option

hence the added

YFLAGS = --infer

variable in the Makefile

The issue I have is that no matter what, OCamlMakefile runs menhir  
before compiling parser/, yielding to a "Unbound module Ir" since  
my parser.mly is trying to "open Ir".
Looking at OCamlMakefile source, it seems to come from the PRE_TARGETS  
variable which always compiles .mly first.

So my question is: what is the proper way of doing it ? Should I just  
drop the --infer menhir's option or is there a better way?

Best Regards,