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:30)
From: Aleksey Nogin <nogin@c...>
Subject: Re: [Caml-list] Omake [Was: Building large and portable projects]
On 21.11.2003 12:39, Damien wrote:

> I looked quickly at it, and tried to use for a project I am currently
> working on,
> however my project uses "-pack" in order to pack some branches
> (sub-directories) and avoid A_B_.._M module names.
> looking at Omakeroot, it seems to me there is no support for things like
> that :-( 
> Has someone already managed to do it ? 

Didn't have time to write more about this earlier today, but it should 
be very simple. The following macro will probably work (haven't tested 
it myself)

OcamlPack(dst, sources) =
       $(dst).cmo $(dst).cmx $(dst).cmi $(dst).o: $(addsuffix .cmo, 
$(sources)) $(addsuffix .cmx, $(sources)) $(addsuffix .o, $(sources)) 
$(addsuffix .cmi, $(sources))
          $(OCAMLOPT) $(OCAMLOPTFLAGS) -pack -o $(dst).cmx $(addsuffix 
.cmx, $(sources))
          $(OCAMLC) $(OCAMLCFLAGS)-pack -o $(dst).cmo $(addsuffix .cmo, 
       $(dst).cmo $(dst).cmi : $(addsuffix .cmo, $(sources)) $(addsuffix 
.cmi, $(sources))
          $(OCAMLC) $(OCAMLCFLAGS)-pack -o $(dst).cmo $(addsuffix .cmo, 

       $(dst).cmx $(dst).cmi $(dst).o: $(addsuffix .cmx, $(sources)) 
$(addsuffix .o, $(sources)) $(addsuffix .cmi, $(sources))
          $(OCAMLOPT) $(OCAMLOPTFLAGS) -pack -o $(dst).cmx $(addsuffix 
.cmx, $(sources))

And then just invoke it using

OcamlPack(foo, bar1 bar2 bar3 ... )

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