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] Building large and portable projects
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-22 (03:51)
From: Aleksey Nogin <nogin@c...>
Subject: Re: [Caml-list] Omake [Was: Building large and portable projects]
On 21.11.2003 15:48, sylvain.le-gall@polytechnique.org wrote:

> Ok. But i am looking for something included in it ( think that in your
> very large project, you have a library that builds against an external
> one, i want that the makefile system detect it and output that it needs
> this library... ).

Well, included is a macro language that should (ideally) allow you to 
define things you want. If needed, you can relatively easily extend the 
language of built-in functions as well (which means you have to change 
omake source code, but it gives you access to full OCaml).

> META file comes with findlib. Findlib is an helper to configure ocaml
> compilation :
> ocamlfind ocamlc -package "fileutils" xxx.ml 
> will run ocamlc -I /usr/lib/ocaml/fileutils ...


> I want ( just as i have posted before ) :
> let my_prog = { name = "my_prog";...;toplevels = [ "X.ml" ] }
> in
> add_target my_prog

Well, does it really have to be written in OCaml?

Note that if one would want to use omake for simple projects, all that 
[s]he would have to learn is couple of macros (which completely hide the 
notions of "target", "dependency", etc) and couple of standard 
variables. E.g, you'd need couple of line for the project:

OCAMLC = ocamlfind ocamlc -package "fileutils"
OCamlProgram(my_prog, X Y Z ...)

Note that the standard macros are not in any way built-in (the way make 
has a big number of built-in rule), they just come from an include file 
(that can be studied and even modified if a small simple project ends up 
growing into a large and complicated one).

Note - if in the example above you do not want to rely on external 
ocamlfind, you could add ocamlfind code to omake, changing the above to

OCAMLINCLUDES += $(ocamlfind fileutils)
OCamlProgram(my_prog, X Y Z ...)

Aleksey Nogin

Home Page: http://nogin.org/
E-Mail: nogin@cs.caltech.edu (office), aleksey@nogin.org (personal)
Office: Jorgensen 70, tel: (626) 395-2907

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners