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.8 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 7AB10BB84 for ; Tue, 10 Feb 2009 23:35:28 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgBAGyPkUnRVdwKk2dsb2JhbACUCj8BAQEBCQkKCREDr0CGdYhKhBoG X-IronPort-AV: E=Sophos;i="4.38,188,1233529200"; d="scan'208";a="23881508" Received: from mail-fx0-f10.google.com ([209.85.220.10]) by mail1-smtp-roc.national.inria.fr with ESMTP; 10 Feb 2009 23:35:28 +0100 Received: by fxm3 with SMTP id 3so132736fxm.3 for ; Tue, 10 Feb 2009 14:35:28 -0800 (PST) MIME-Version: 1.0 Sender: hcarty@mulethief.com Received: by 10.103.192.2 with SMTP id u2mr3104559mup.95.1234305184968; Tue, 10 Feb 2009 14:33:04 -0800 (PST) In-Reply-To: References: Date: Tue, 10 Feb 2009 17:33:04 -0500 X-Google-Sender-Auth: b9baecafa3b4a802 Message-ID: <3a360f590902101433t1f955f6cw908c77bedb053d80@mail.gmail.com> Subject: Re: [Caml-list] ocamlbuild rules generating multiple files From: "Hezekiah M. Carty" To: =?UTF-8?Q?Daniel_B=C3=BCnzli?= Cc: OCaml List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; buenzli:01 basename:01 camlidl:01 idl:01 idl:01 camlidl:01 mli:01 stubs:01 deps:01 pathname:01 seq:01 foo:01 foo:01 10,:98 2009:98 On Tue, Feb 10, 2009 at 5:15 PM, Daniel B=C3=BCnzli wrote: > If in a rule a command generates multiple files (which don't necessary ha= ve > the same basename as the dep), how can I make ocamlbuild understand that > these files now exist in _build ? I've used the following rule under After_rules in myocamlbuild.ml for camlidl .idl files: (* Handle *.idl files properly... I think *) rule "camlidl processing" ~prods:["%.mli"; "%.ml"; "%_stubs.c"] ~deps:["%.idl"] begin fun env _build -> let idl =3D env "%.idl" in let tags =3D tags_of_pathname idl++"compile"++"camlidl" in let cmd =3D Cmd(S[camlidl; T tags; P idl]) in Seq [cmd] end; Then, given foo.idl, "ocamlbuild foo.cma" seems to work properly, finding the relevant camlidl-output files. Hope this helps. Hez --=20 Hezekiah M. Carty Graduate Research Assistant University of Maryland Department of Atmospheric and Oceanic Science