caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: Stefano Zacchiroli <zack@upsilon.cc>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] ocamlbuild vs INCLUDE: how to copy snippets into _build/ ?
Date: Sat, 08 Nov 2008 16:49:24 +0100	[thread overview]
Message-ID: <1226159223-sup-3570@ausone.local> (raw)
In-Reply-To: <20081108150940.GA24353@usha.takhisis.invalid>

Excerpts from Stefano Zacchiroli's message of Sat Nov 08 16:09:40 +0100 2008:
> I'm using ocamlbuild and camlp4oof to exploit the INCLUDE syntax
> extension, that is have camlp4 expand in the obvious way stuff like:
> 
>   INCLUDE "some/relative/path/snippet.mli"
> 
> The path passed to INCLUDE is relative to the including file, but with
> ocamlbuild I've a problem. Namely, the snippet is not copied inside
> the appropriate subdir of _build, and camlp4 correctly fails with
> something like:
> 
>   File "some/relative/path/snippet.mli", line 52, characters 0-3:
>   I/O error: "some/relative/path/snippet.mli: No such file or directory"
>   Preprocessing error on file src/foo/bar/including.mli
>   Command exited with code 2.
> 
> The snippet is not otherwise processed by the OCaml toolchain, it is
> just meant to be INCLUDEd.
> 
> How can I tell ocamlbuild to copy into the _build/ directory my
> snippets?
> 
> My reading of the manual doesn't hint me to any useful tag ...

Try to have something like

  open Ocamlbuild_plugin
  dispatch begin function
  | After_rules ->
      dep ["file:src/foo/bar/including.mli"] ["some/relative/path/snippet.mli"]
  end

to your myocamlbuild.ml

-- 
Nicolas Pouillard aka Ertai


      parent reply	other threads:[~2008-11-08 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-08 15:09 Stefano Zacchiroli
2008-11-08 15:22 ` [Caml-list] " Stéphane Glondu
2008-11-08 15:49 ` Nicolas Pouillard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226159223-sup-3570@ausone.local \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=zack@upsilon.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).