English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Automake support for OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-12-22 (08:44)
From: Tom Murray <yozhik@c...>
Subject: [Caml-list] Automake support for OCaml

I've been working on a patch to automake to support packages with Caml 

Current features include compilation of programs and libraries, 
possibly with mixed Caml and C code, automatic dependency generation, 
and both bytecode and native code compilation. To get an idea, here is 
a sample Makefile.am:

CAML_INCLUDES = -I ../ -pp "camlp4o pa_extend.cmo"
CAML_LDADD    = unix.cma

bin_MLPROGRAMS = myprog
lib_MLLIBRARIES = mylib.cma

myprog_SOURCES = myprog.mli myprog.ml myprog_c.c

mylib_cma_SOURCES = mylib1.ml mylib2.ml
mylib_cma_LIBADD  = otherlib.cma

This defines a program and a library to be built. Typing "make all" 
will build myprog and mylib.cma. Typing "make opt" will build 
myprog.opt and mylib.cmxa. The CAML_INCLUDES variable applies the -I 
flag and an invocation of Camlp4 to all targets. The CAML_LDADD links 
in unix.cma with bytecode targets, unix.cmxa with native code. Also 
note that myprog includes an interface file myprog.mli that is compiled 
to myprog.cmi, but of course excluded from the link. The mylib.cma 
library also links in otherlib.cma (or otherlib.cmxa).

The main things left to do are:
* install support (I plan to use ocamlfind)
* m4 macros to ease searching for Caml libraries on the system
* support for more tools such as ocamllex/ocamlyacc (you _can_ do this 
manually now, of course)
* improved integration with C

A little page and download are at 

Your comments and suggestions are appreciated.