From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id F3BFBBBB7 for ; Tue, 30 Sep 2008 18:55:48 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkwDABP34UjAXQIniGdsb2JhbACTQgEBARUiqwiBZw X-IronPort-AV: E=Sophos;i="4.33,338,1220220000"; d="scan'208";a="15517293" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 30 Sep 2008 18:55:48 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m8UGtmZW011792 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 30 Sep 2008 18:55:48 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkwDAHf34UjCpx6wiGdsb2JhbACTQgEBARUiqyGBZw X-IronPort-AV: E=Sophos;i="4.33,338,1220220000"; d="scan'208";a="17515300" Received: from smtpmin.univ-orleans.fr (HELO min.univ-orleans.fr) ([194.167.30.176]) by mail3-smtp-sop.national.inria.fr with ESMTP; 30 Sep 2008 18:55:28 +0200 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by min.univ-orleans.fr (Postfix) with ESMTP id DBB4B12B49F; Tue, 30 Sep 2008 18:55:27 +0200 (CEST) Received: from [192.168.0.12] (ras75-4-82-235-58-110.fbx.proxad.net [82.235.58.110]) by smtps.univ-orleans.fr (Postfix) with ESMTP id 36B8A36E60; Tue, 30 Sep 2008 18:55:30 +0200 (CEST) Subject: Re: OCamlBuild question From: David Teller To: Nicolas Pouillard Cc: caml-list In-Reply-To: <1222770687-sup-2064@ausone.local> References: <1222759631.6764.4.camel@Blefuscu> <1222770687-sup-2064@ausone.local> Content-Type: text/plain; charset=utf-8 Date: Tue, 30 Sep 2008 16:49:01 +0200 Message-Id: <1222786141.13637.3.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 48E25A14.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; univ-orleans:01 j'arrive:01 mli:01 compilation:01 0200,:01 statically:01 deps:01 deps:01 mli:01 dirs:01 pathname:01 dirs:01 pathname:01 dirname:01 ocaml:01 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 ? Merci, David 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/ocaml_tools.ml file for a similar function > (import_mlypack). > -- David Teller-Rajchenbach Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller Angry researcher: French Universities need reforms, but the LRU act brings liquidations.