Version française
Home     About     Download     Resources     Contact us    
Browse thread
Toplevel - loading dependencies
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Florent Monnier <fmonnier@l...>
Subject: Re: [Caml-list] Toplevel - loading dependencies
> If I put everything into one big cma, then I have to recompile it every
> small change. It takes so long time, that it would make no sense to use
> the interpreter at all.

in case you're doing so this way:
ocamlc -o my.cma mod1.ml mod2.ml mod3.ml mod4.ml

this will recompile everything,
but you can use in your makefile:
%.cmo: %.ml
        ocamlc.opt -c $<
my.cma: mod1.cmo mod2.cmo mod3.cmo mod4.cmo
        ocamlc.opt -a -o $@ $^

then you don't recompile everything, only the modified module

if there are dependencies between modules, just add additional rules:
modfoo.cmo: modfoo.ml modbar.cmi