Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: ChoJin <chojin@l...>
Subject: OCamlMakefile, menhir and its --infer option
Hello,

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

I have something along those lines:

OCAMLYACC = menhir

SOURCES = \
	parser/ir.ml \
	parser/parser.mly \
	parser/lexer.mll \
	main.ml

[...]

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/ir.ml, 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,
ChoJin