Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: -- (:)
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:
E-Mail: (office), (personal)
Office: Jorgensen 70, tel: (626) 395-2907

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: