From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p53AEhgT014647 for ; Fri, 3 Jun 2011 12:14:43 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao0DAB6z6E2GnQCBkWdsb2JhbABTmBqOHhQBAQEBCQsLBxQDIqw4nxqGIQSgLw X-IronPort-AV: E=Sophos;i="4.65,314,1304287200"; d="scan'208";a="84585231" Received: from shiva.jussieu.fr ([134.157.0.129]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Jun 2011 12:14:38 +0200 Received: from hydrogene.pps.jussieu.fr (hydrogene.pps.jussieu.fr [134.157.168.1]) by shiva.jussieu.fr (8.14.4/jtpda-5.4) with ESMTP id p53AEbkD039663 for ; Fri, 3 Jun 2011 12:14:37 +0200 (CEST) X-Ids: 164 Received: by hydrogene.pps.jussieu.fr (Postfix, from userid 2065) id 45C66C337F; Fri, 3 Jun 2011 12:14:36 +0200 (CEST) Date: Fri, 3 Jun 2011 12:14:36 +0200 From: Pietro Abate To: caml-list@inria.fr Message-ID: <20110603101436.GB19919@pps.jussieu.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: GNU/Linux User-Agent: Mutt/1.5.20 (2009-06-14) X-Miltered: at jchkmail.jussieu.fr with ID 4DE8B40D.002 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 4DE8B40D.002/134.157.168.1/hydrogene.pps.jussieu.fr/hydrogene.pps.jussieu.fr/ Subject: [Caml-list] for-pack, ocamlbuild and polluted namespace Hello, I'm trying to fix the build system of my project to fit the debian policy, but I having few problems with ocamlbuild... I'm using the ocaml 3.12. suppose I've 3 modules. A, B, C where A does not have any dependencies B depends on A and C depends on A and B. assume further that B and C use the same file name for a submodule. the situation looks like : A/a.ml B/aa.ml B/b1.ml C/aa.ml C/c1.ml I want to build three libraries avoiding name space clashes using for-pack. So at the end of the compilation I will have. A.cmxa (containing A/A.cmx) B.cmxa (containing B/Aa.cmx , B/B1.cmx) C.cmxa (containing C/Aa.cmx , C/C1.cmx) now using ocamlbuild I set up a _tags file with or : use_a or : use_a, use_b : for-pack(A) : for-pack(B) : for-pack(C) ------- and my myocmamlbuild looks like : open Ocamlbuild_plugin;; ocaml_lib ~dir:"a" "a/a"; ocaml_lib ~dir:"b" "b/b"; ocaml_lib ~dir:"c" "c/c"; ----- so far so good. A.cmxa is ok, no dependencies. B.cmxa is also ok. The problem is with C.cmxa that tries to resolve its dependencies with the interface of the wrong module in b (b/Aa.cmi) instead of the module in c (this is because of the -I b added by the ocaml_lib directive). Of course this is just a leftover of the compilation since everything is already packed. I don't need the cmi of the individual submodules. If I remove _build/b/Aa.* by hand everything works as expected... my question is : How can write an ocamlbuild rule to remove all the submodules leftover in the directory _build/b leaving only the cmi of the packed module ? Or more generally, would not be a good idea to remove these leftovers automatically is -for-pack is used to put all submodules together ? Reg the first question what I need is a way to get the list of all the submodules and then issuing a rm_f command after packing the library... but how can I get this list ? thanks, pietro -- ---- http://en.wikipedia.org/wiki/Posting_style