From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 88B92BBAF for ; Fri, 23 Oct 2009 18:13:47 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8BAHNy4UrRVdnakGdsb2JhbACEcopuiw0/AQEBAQkJDAcTA6xZghWGUIhMgTKCOlMEgV0 X-IronPort-AV: E=Sophos;i="4.44,613,1249250400"; d="scan'208";a="35502527" Received: from mail-gx0-f218.google.com ([209.85.217.218]) by mail2-smtp-roc.national.inria.fr with ESMTP; 23 Oct 2009 18:13:47 +0200 Received: by gxk10 with SMTP id 10so8366830gxk.3 for ; Fri, 23 Oct 2009 09:13:46 -0700 (PDT) MIME-Version: 1.0 Sender: hcarty@mulethief.com Received: by 10.150.48.40 with SMTP id v40mr18572529ybv.142.1256314426094; Fri, 23 Oct 2009 09:13:46 -0700 (PDT) In-Reply-To: <806031.45357.qm@web111508.mail.gq1.yahoo.com> References: <806031.45357.qm@web111508.mail.gq1.yahoo.com> From: "Hezekiah M. Carty" Date: Fri, 23 Oct 2009 11:13:26 -0500 X-Google-Sender-Auth: b8eb72bf64224a99 Message-ID: <3a360f590910230913l5cdea067l843b4f1ce219b360@mail.gmail.com> Subject: Re: [Caml-list] Ocamlbuild + unexpected dependency To: Dario Teixeira Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; syntax:01 foobar:01 foobar:01 camlidl:01 23,:98 2009:98 wrote:01 compile:01 caml-list:01 dependency:01 dependency:01 data:02 data:02 external:03 external:03 On Fri, Oct 23, 2009 at 11:04 AM, Dario Teixeira wrote: > > I'm using the Xstrp4 syntax extension to include an external > file "data.txt" inside a "foobar.ml" file.=C2=A0 I'm also using > ocamlbuild to build the project.=C2=A0 How do I tell ocamlbuild > that data.txt should be also be copied to the _build directory > for building?=C2=A0 Ocamlbuild by default has no way of knowing that > foobar.ml depends on data.txt.=C2=A0 (I am presently using an absolute > path to get around this, which is not very portable). > I'm not sure if there is a better way to do this, but you can add the dependency in your myocamlbuild.ml file. Add something along the lines of this: --- let xstrp4_includes =3D "data.txt" ... | After_rules -> ... dep ["compile"; "the_xstrp4_tag"] xstrp4_includes; --- I use this to support external includes with camlidl + ocamlbuild. Hope this helps, Hez --=20 Hezekiah M. Carty Graduate Research Assistant University of Maryland Department of Atmospheric and Oceanic Science