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: sylvain.le-gall@p...
Subject: Re: [Caml-list] Omake [Was: Building large and portable projects]
Hello, again

On Fri, Nov 21, 2003 at 11:30:29AM -0800, Aleksey Nogin wrote:
> On 21.11.2003 10:55, wrote:
> >Is there way to define camlp4 syntax ? ( for example needs camlp4
> >with cmo zoggy.cmo or something like that )
> Yes, the syntax would be something like
> if true
>    OCAMLFLAGS += -pp "camlp4 zoggy.cmo"
>    XXX.cmx XXX.o:
>    XXX.cmo:
> The idea is the following:
> - variables inside the "if" statements are locally scope (unless you 
> explicitly export the variable environment back to the parent scope), so 
> we use the "if true" as a synonym for "local". So, the above tells omake 
> to add a preprocessor flag to ocamlc/ocamlopt when compiling XXX.cmx, 
> XXX.o and XXX.cmo.
> Alternatively, you could define a helper macro:
> UseCamlp4(modules, files) =
>    OCAMLFLAGS += -pp "camlp4 $(addsuffix .cmo, $(modules))"
>    $(addsuffix .cmx, $(modules)) $(addsuffix .o, $(modules)):
>    $(addsuffix .cmo, $(modules)):
> UseCamlp4(zoggy, XXX)
> Actually, it might be a good idea to add such a macro to the global 
> rules file included with omake - I filed 
> on this.
> >Is there a kind of configure in it ?
> There are a number of mechanisms for hooking to an external one. For 
> example, you could specify dependencies and commands when including file as:
> .INCLUDE: foo
>    bla bla > foo
> .INCLUDE: foo:
>    bla bla bla bla < > foo

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... ).

> if $(not $(equal $(OSTYPE), Win32))
>     OMakefile: config.status
>    @echo "*** Build system is out-of-date, rebuilding ***"
>    $(DOT)config.status
>    @echo "*** OMakefile was rebuilt, session should restart ***"

In fact i want to get rid of it ( no $(DOT)config.status ). Autools et
al are very well made but i think that it is too much complicated (
having try to understand how it is build but most of the time i really
can t get into it ).

> >Can you use META files.
> Not sure what those are.

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

Gerd Stolpmann write it ( ). Sorry to the
author if i mistyped his name...

I take a quick glance to you OMakefile...

Well i think it is very powerfull and very interesting... But ( there is
always a but ), i am looking for something between your very complete
suite and ocamake which is light and permits to do fast job for ocaml

I know, i will run into problem if not targeting all people... But, i
cannot choose all options. I want something enough powerfull to build
little to medium ocaml project -- with some C binding. I don't want to
rebuild make. The ideal project ( in size ) will be cameleon ( fully
written in ocaml ) or mldonkey ( mostly ocaml with some C ). I don't
really want to be able to compile C, python, Ada...

I want to use some kind of ocaml script ( let say which will
contain the instruction to build, explains the dependency etc ) to
enable user to be fully consistent with their project ( they learn ocaml
and not makefile syntax ). I think it should be necessary to have a
plugin system ( through dynlink or topfind, don't know yet ) to enable them 
to develop their own set of rules ( if they want to compile specific
things ).

What i have read in you omakefile is a kind of full rewrite of make ( ie
you have construct of function, dependency etc ). I precisely don't want 
to develop my own langage for this purpose, i want to have it written in

Just to give you an example, all the student i know have problem using
makefile because they don't want to spend two hours understanding this
big script... So they simply don't use it... How many times i have seen
one-file-project without makefile, or people using "ocamlc &&
ocamlc && ocamlc"

I want ( just as i have posted before ) :

let my_prog = { name = "my_prog";...;toplevels = [ "" ] }
add_target my_prog

and that's all. And i want to be able to do it on linux or win without
being needed to do if Win32 then ... else ... ( every time you write if
... else ..., it is a possible infinite source of error ).

I will have a deeper look to your omakefile ( understanding how it is
working, if i can learn from the rules to target process ... ). 

thanks for having helped me to find more project similar to mine.

Kind regard
Sylvain LE GALL

ps : i cannot find your project omakefile on humps
pps : if you have time you could take a look at cameleon CVS, branch
findlib :, there is a bunc
of ten lines makefile which are sufficient to define what to compile for
each directory... That is the mininum sums of information i want user to
give to have a fully working makefile system

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