New Makefile for OCAML

From: Markus Mottl (
Date: Sun Jun 06 1999 - 17:26:31 MET DST

From: Markus Mottl <>
Message-Id: <>
Subject: New Makefile for OCAML
Date: Sun, 6 Jun 1999 16:26:31 +0100 (MET DST)


I have released a new version of "OcamlMakefile" just recently - it has
greatly improved over the last release!

Some new features:

  * Dependency calculation should now be 100% correct (well-tested) -
    even for automatically generated sources. As far as I know there is
    no other generic Makefile for OCAML that can do this correctly.

  * It can now automatically handle IDL-files (.idl) together with C-files

  * Distribution comes with some examples

Some of the older and now improved features include:

  * byte-code or native-code generation

  * builds executables or libraries on request

    make bc -> makes byte-code executable
    make ncl -> makes native-code library

  * "ocamllex" (.mll) and "ocamlyacc" (.mly) support

  * easy thread support: just say "THREADS = yes"

  * effortless linking against OCAML- and other libraries.
      LIBS = str unix graphics
      LIBDIRS = /usr/X11/lib
      CLIBS = X11

The usability is also much better now - it is sufficient to put the
OcamlMakefile somewhere on the system and make use of its features by
simply "including" it from other Makefiles (see README for details).

Here an example Makefile of a fairly complex project (taken from the
example "calc" in the distribution):

OCAMLMAKEFILE = ../OcamlMakefile

SOURCES = test_impl.c test.idl parser.mly lexer.mll
RESULT = calc


This example makes use of a lot of features that normally require somewhat
complex compilation and linkage, but OcamlMakefile can handle all these
steps automatically. Because dependency calculation is correct in contrast
to most other solutions, rebuild times are minimal.

I hope that this project will relieve your from the effort of managing
the compilation process of your sources.

Beginners who are not so familiar with writing Makefiles will have a big
advantage, especially if they want to explore the advanced development
tools of OCAML (ocamllex, ocamlyacc, camlidl).

Read the README of the distribution for more details!

Here the URL (free download):

Get "ocaml_make.tar.gz" there or browse the distribution... Enjoy it!

Best regards,
Markus Mottl

Markus Mottl,,

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:23 MET