caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Francois Berenger <francois.berenger@inria.fr>
To: caml users <caml-list@inria.fr>
Subject: [Caml-list] getting rid of ocamlbuild's .mlpack files in a project
Date: Thu, 20 Aug 2015 15:36:06 +0200	[thread overview]
Message-ID: <55D5D7C6.5050300@inria.fr> (raw)

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.


             reply	other threads:[~2015-08-20 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-20 13:36 Francois Berenger [this message]
2015-08-20 14:01 ` Fabrice Le Fessant

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=55D5D7C6.5050300@inria.fr \
    --to=francois.berenger@inria.fr \
    --cc=caml-list@inria.fr \
    /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).