English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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