From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 65B17BC0A for ; Sat, 24 Mar 2007 19:58:25 +0100 (CET) Received: from smtp.uibk.ac.at (lmr1.uibk.ac.at [138.232.1.142]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2OIwOL4007352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 24 Mar 2007 19:58:25 +0100 Received: from smc.uibk.ac.at (smc.uibk.ac.at [138.232.1.226] c703350@smc.uibk.ac.at) by smtp.uibk.ac.at (8.13.8/8.13.1/F1) with ESMTP id l2OIwNpn032486 for ; Sat, 24 Mar 2007 19:58:23 +0100 Received: from smc.uibk.ac.at (localhost [127.0.0.1] c703350@smc.uibk.ac.at) by smc.uibk.ac.at (8.13.8+Sun/uibk) with ESMTP id l2OIwNpd002556 for ; Sat, 24 Mar 2007 19:58:23 +0100 (MET) Received: (from c703350@localhost) by smc.uibk.ac.at (8.13.8+Sun/8.13.8/Submit) id l2OIwNvY002555 for caml-list@inria.fr; Sat, 24 Mar 2007 19:58:23 +0100 (MET) Date: Sat, 24 Mar 2007 19:58:23 +0100 From: Christian Sternagel To: caml-list@inria.fr Subject: documentation for building C++ libraries with ocamlbuild Message-ID: <20070324185823.GA10280@pc6197-c703.uibk.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i X-Scanned-By: MIMEDefang 2.58 at uibk.ac.at on 138.232.1.140 X-Miltered: at discorde with ID 460574D0.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lib:01 lib:01 makefile:01 compiler:01 ocamlc:01 -custom:01 cmo:01 -cclib:01 ocamlc:01 -cclib:01 cmo:01 makefile:01 cheers:01 compile:01 compile:01 Is there some documentation or at least a tutorial for how to setup ocamlbuild in order to build a lib.a file from a bunch of *.c, *.C, and *.h files? And after having done that, how to tell ocamlbuild that some ocmal-program which is build depends on lib.a. Currently I build lib.a using a Makefile and the g++ compiler. After that I create a .cma like ocamlc -cc g++ -ccopt -L -a -o .cma -custom \ -cclib -l Then I compile the program using the ocaml-interfaced C++ library like ocamlc -cc g++ -o -ccopt -L.a> \ -cclib -l .cma For each of the 3 steps I need a different Makefile and almost always when something changes I have to do the cumbersome make clean; make depend; make cycle to avoid any compile errors like inconsistent assumptions over interfaces. There should be an easier way, shouldn't it? cheers christian