Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
ocamlbuild vs INCLUDE: how to copy snippets into _build/ ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-11-08 (15:09)
From: Stefano Zacchiroli <zack@u...>
Subject: ocamlbuild vs INCLUDE: how to copy snippets into _build/ ?
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

My reading of the manual doesn't hint me to any useful tag ...


Stefano Zacchiroli -*- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{,,} -<>-
Dietro un grande uomo c'è sempre /oo\ All one has to do is hit the right
uno zaino        -- A.Bergonzoni \__/ keys at the right time -- J.S.Bach