From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 9478B7EE25 for ; Tue, 29 Oct 2013 22:45:51 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of michipili@gmail.com) identity=pra; client-ip=209.85.215.178; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="michipili@gmail.com"; x-sender="michipili@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of michipili@gmail.com designates 209.85.215.178 as permitted sender) identity=mailfrom; client-ip=209.85.215.178; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="michipili@gmail.com"; x-sender="michipili@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ea0-f178.google.com) identity=helo; client-ip=209.85.215.178; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="michipili@gmail.com"; x-sender="postmaster@mail-ea0-f178.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtoCAMQrcFLRVdeylGdsb2JhbABZgz/BNhYOAQEBAQcLCwkSKoJeAQ0BGxwCAxIQBw8TAxgDAgECARERAQUBDiEIAhKHXgEDDwQBCJhkgwSMV4MKhEEKGScNZIkBAQEEDI9ShBYDmAqQHEGEUg X-IPAS-Result: AtoCAMQrcFLRVdeylGdsb2JhbABZgz/BNhYOAQEBAQcLCwkSKoJeAQ0BGxwCAxIQBw8TAxgDAgECARERAQUBDiEIAhKHXgEDDwQBCJhkgwSMV4MKhEEKGScNZIkBAQEEDI9ShBYDmAqQHEGEUg X-IronPort-AV: E=Sophos;i="4.93,596,1378850400"; d="scan'208";a="39532092" Received: from mail-ea0-f178.google.com ([209.85.215.178]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 29 Oct 2013 22:45:39 +0100 Received: by mail-ea0-f178.google.com with SMTP id a15so227867eae.9 for ; Tue, 29 Oct 2013 14:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=KB7+Q8RniGEwvZsUM4blaJHfAWLdKwIxM5HiAhThJ7g=; b=sjtmngmEO9Q/UF3iq2daodRZgCghp4dBqAObq882YfEKkMOHjhSn9XvB7V6VqgDGaH BBJFXOTW+kaQ18O4cUKQEI/Kcnx1m5z1jWtmZ/tHb/waz6hPggkfXFOz8CkYJEGMhvjk 7BlNU7uhMwacJ+kzAvUN3iFpsRE5Zp45nj9TmnmzgVsh4s71TY6nWxEE6EDmAZkPmXFd XeiGT6myBHzkicYtegj7cx5J4PXOrSv6tzfoQzyPBOfLL5ehxKUlECTEWY72ju1qxnaF C4a11JX5GGYw/BwiW3oulEfI8U791rfvusP/LRWlfVGoGqLPFdBHserAC4hR7Ooe+mm3 KqOw== X-Received: by 10.15.61.66 with SMTP id h42mr1689692eex.62.1383083150727; Tue, 29 Oct 2013 14:45:50 -0700 (PDT) Received: from llea.celt.neu (xdsl-89-0-87-170.netcologne.de. [89.0.87.170]) by mx.google.com with ESMTPSA id k7sm75180728eeg.13.2013.10.29.14.45.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Oct 2013 14:45:49 -0700 (PDT) Message-ID: <52702C8C.3040900@gmail.com> Date: Tue, 29 Oct 2013 22:45:48 +0100 From: =?windows-1252?Q?Michael_Gr=FCnewald?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Firefox/24.0 SeaMonkey/2.21 MIME-Version: 1.0 To: caml-list@inria.fr Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: [Caml-list] A useful Makefile collection for OCaml projects 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