English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Ocamlbuild + unexpected dependency
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-10-23 (16:13)
From: Hezekiah M. Carty <hcarty@a...>
Subject: Re: [Caml-list] Ocamlbuild + unexpected dependency
On Fri, Oct 23, 2009 at 11:04 AM, Dario Teixeira
<darioteixeira@yahoo.com> wrote:
> I'm using the Xstrp4 syntax extension to include an external
> file "data.txt" inside a "foobar.ml" file.  I'm also using
> ocamlbuild to build the project.  How do I tell ocamlbuild
> that data.txt should be also be copied to the _build directory
> for building?  Ocamlbuild by default has no way of knowing that
> foobar.ml depends on data.txt.  (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 = "data.txt"

| After_rules ->

dep ["compile"; "the_xstrp4_tag"] xstrp4_includes;

I use this to support external includes with camlidl + ocamlbuild.

Hope this helps,


Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science