caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Michael Grünewald" <michipili@gmail.com>
To: caml-list@inria.fr
Subject: [Caml-list] A useful Makefile collection for OCaml projects
Date: Tue, 29 Oct 2013 22:45:48 +0100	[thread overview]
Message-ID: <52702C8C.3040900@gmail.com> (raw)

Dear Ocamllers!


I use a moderately sophisticated collection of Makefile to build my
OCaml-based projects. I recently decided to polish its organisation and
documentation, because it might be useful to someone else. If you are
interested in trying it, check your backups and visit

https://bitbucket.org/michipili/bsdmakepscripts

Installation instructions are found on this page and an example for a
simple ocaml program.

Of course, your feedback would be much appreciated and I would try to
answer questions that you may have!

It is usable with BSD Make and some variants. On FreeBSD it is `make`,
on other BSDs it is probably `make` as well, on Mac OS X it is `bsdmake`
and on Debian it is `pmake`. If you do not have any of these programs,
you may install bmake, see
https://bitbucket.org/michipili/bsdmakepscripts/wiki/BMake.


FEATURES OVERVIEW

- It is written for make(1) and it is thus easy to extend or to
integrate in a typical unixish workflow.
- It supports OBJDIRPREFIX, which means you can separate sources and
object files and implement “compilation profiles” having products stored
in different directories.
- It supports parallel build at the “directory granularity level”.
- It supports ocamlfind, ocamldoc, ocamldepends, ocamllex and ocamlyacc.
- It supports the production of GPG-signed distfile tarballs.

Aside from compiling OCaml programs, it can do many more useful things
(typeset with TeX, weave and tangle with noweb).


EXAMPLES & DOCUMENTATION

There are examples in the `test/ocaml' subdirectory, each subdirectory
is a toy product demonstrating some features. The `miniproj-3' displays
use of the most advanced features.

Recipes for building OCaml based products are found in the Wiki:

https://bitbucket.org/michipili/bsdmakepscripts/wiki/DevelopOCamlSoftware


HEY, I THOUGHT MAKEFILES WERE OBSOLETE!

Makefile-based build systems might have limitations and shortcomings[*],
but:

- Writing Makefiles is a *generic* competence useful to all *NIX users,
so these build systems rely on something you more or less already know
or want to learn.

- Since Makefile are *generic* you can also build non-OCaml pieces of
your system with them, so these build systems rely on a single tool.

- There are ambitious build systems relying exclusively on makefiles, as
FreeBSD's (and other BSD's I guess), so these build systems have a
proved ability to scale to very large projects.

[*] It requires a suitable architecture and organisation to support
dependencies across directories.


OCAMLBUILD

Since I started my education at the university of Montpellier where I
met Berke Durak, one of the authors of `ocamlbuild`, I feel appropriate
to stress that ***this is not a concurrent project to ocamlbuild***! :-)


Have fun with these make macros!

-- 
Michael



             reply	other threads:[~2013-10-29 21:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29 21:45 Michael Grünewald [this message]
     [not found] ` <52706214.8090504@riken.jp>
2013-10-30  6:55   ` Michael

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=52702C8C.3040900@gmail.com \
    --to=michipili@gmail.com \
    --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).