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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id F0DBABC0A for ; Tue, 13 Mar 2007 19:38:13 +0100 (CET) Received: from hub.hrl.com (hub.hrl.com [208.179.241.200]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2DIcCZg032228 for ; Tue, 13 Mar 2007 19:38:13 +0100 Received: from [192.27.172.110] (dangle.hrl.com [192.27.172.110]) by hpux03.hrl.com (iPlanet Messaging Server 5.2 HotFix 2.10 (built Dec 26 2005)) with ESMTP id <0JEU007ZUUFLDX@hpux03.hrl.com> for caml-list@inria.fr; Tue, 13 Mar 2007 11:38:09 -0700 (PDT) Date: Tue, 13 Mar 2007 11:38:09 -0700 From: Aleksey Nogin Subject: Re: [Caml-list] ocamlbuild is VERY nifty In-reply-to: To: Joel Reymont Cc: Caml List Message-id: <45F6EF91.4090704@metaprl.org> Organization: MetaPRL/Mojave Research Group MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Thunderbird 1.5.0.10 (X11/20070301) References: X-Miltered: at concorde with ID 45F6EF94.006 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 bytecode:01 compilation:01 ocamlopt:01 byte:01 ocamlfind:01 lexer:01 parser:01 parser:01 util:01 symtab:01 byte:01 mli:01 lexer:01 mll:01 On 07.03.2007 07:53, Joel Reymont wrote: > I asked around before settling on a build system since I'm new to OCaml. > I looked at OMake, OCamlMakefile and found them complex and confusing. Well, it should have been equally easy to use OMake in this case - while it is true that OMake is complex, the complexity is only there to help you out when you need it; you can safely ignore it until then. If I understand what you are doing here correctly, it would have been sufficient to just use the following OMakefile: --------- # Optional - use bytecode compilation even when ocamlopt is available NATIVE_ENABLED = false BYTE_ENABLED = true USE_OCAMLFIND = true OCAMLPACKS[] = ounit .DEFAULT: $(OCamlProgram test, test easy easy_lexer easy_parser parser_util symtab parser_test) ------- and then simply running "omake" would do what you want. > Then William Neuman pointed me to ocamlbuild and Nicolas Pouillard > helped me hook it up to external libraries via a plugin. > > Deep into my first project I confirm that ocamlbuild is VERY nifty. I > can automatically rebuild when any parts of my project change and then > run my unit tests. > > All I need to do is: > > ocamlbuild test.byte -- > > *** my project *** > > 189 easy.mli > 282 easy_lexer.mll > 420 easy_parser.mly > 17 myocamlbuild.ml > 14 parser_util.ml > 30 symtab.ml > 8 test.ml > 284 parser_test.ml > 1355 total > > *** test.ml *** > > open OUnit > > let suite = "Morpher" >::: > [Parser_test.suite] > > let _ = > run_test_tt_main suite > > *** myocamlbuild.ml *** > > open Ocamlbuild_plugin;; > open Command;; > > let packages = "ounit" (* "pkg1,pkg2,..." *);; > > let ocamlfind cmd = > S[A"ocamlfind"; A cmd; A"-package"; A packages];; > > flag ["ocaml"; "link"] (A"-linkpkg");; > > dispatch begin function > | After_options -> > Options.ocamlc := ocamlfind "ocamlc"; > Options.ocamlopt := ocamlfind "ocamlopt"; > | _ -> () > end > > -- > http://wagerlabs.com/ > > > > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >