caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] getting rid of ocamlbuild's .mlpack files in a project
@ 2015-08-20 13:36 Francois Berenger
  2015-08-20 14:01 ` Fabrice Le Fessant
  0 siblings, 1 reply; 2+ messages in thread
From: Francois Berenger @ 2015-08-20 13:36 UTC (permalink / raw)
  To: caml users

Dear list,

Just a quick note for posterity on how to remove a .mlpack file
from a project, since Google was not my friend on this subject.

.mlpack files are a feature supported by ocamlbuild.
As documented in section 18.3.16 of
http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual032.html

I think only ocamlbuild supports .mlpack files.
So, you might want to get rid of them because you are switching
a project to another build system.
Or, maybe, you want the "feature" without becoming bound to ocamlbuild.

In any case, here is a recipe that works for me.

I replaced the file

util.mlpack
---
util/Toto
---

by the file

util.mlp
---
module Toto :
sig
#include "util/toto.mli"
end = struct
#include "util/toto.ml"
end
---

Then, using the excellent cppo ocaml preprocessor from Martin Jambon,
you can do:

cppo util.mlp > util.ml

I think this util.ml file does explicitely what the util.mlpack file was 
doing when processed by ocamlbuild, at the cost of a preprocessing step.

Best regards,
Francois.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-20 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 13:36 [Caml-list] getting rid of ocamlbuild's .mlpack files in a project Francois Berenger
2015-08-20 14:01 ` Fabrice Le Fessant

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).