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
OCamlBuild question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Teller <David.Teller@u...>
Subject: Re: OCamlBuild question
Merci, avec ces explications, je suis enfin arrivé à faire fonctionner
[build]. Maintenant, reste un problème tout bête : j'arrive à écrire le
contenu de mon .mli dans _build mais pour des raisons qui m'échappent,
celui-ci est effacé avant la fin de la compilation. J'ai essayé de
l'ouvrir avec [open_out] et avec [with_output_file], avec le même
résultat. C'est assez frustrant. Des idées ?


On Tue, 2008-09-30 at 12:40 +0200, Nicolas Pouillard wrote: 
> If you need (depend) on files that you statically know then the ~deps argument
> is fine (~deps:["%.mli.depends"; "%.mli"]). If you need files that you only
> know dynamically then the 'build' argument function is for that purpose.
> > As for part 1, it requires the ability to find which source .ml / .mli
> > correspond to a given module. I can only assume OCamlBuild offers some
> > kind of API for this purpose, because I'd rather avoid folding through
> > the whole tree, resolving [include] directives myself to find a .ml or
> > a .mli which may be the right file.
> Yes the function is called expand_module it takes 3 arguments, the include
> directories, the module name, the extensions.
>    Example: let include_dirs = Pathname.include_dirs_of (Pathname.dirname mlpack)
>             in build (expand_module include_dirs module_name ["mli"; "mli.depends"])
> Have a look to the ocamlbuild/ file for a similar function
> (import_mlypack).
David Teller-Rajchenbach
 Security of Distributed Systems
 Angry researcher: French Universities need reforms, but the LRU act brings liquidations.