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: 2003-11-21 (19:30)
From: Aleksey Nogin <nogin@c...>
Subject: [Caml-list] Omake [Was: Building large and portable projects]
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:

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:

    bla bla > foo

.INCLUDE: foo:
    bla bla bla bla < > foo

The above tell omake that
- it should include foo and if the file does not exist, it should use 
"bla bla" to generate it. Next, it should check whether foo is newer 
than and generate foo again (using "bla bla blah blah" this time) 
and then include it again.

You can also specify dependencies for the OMakefile itself:

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

> Can you use META files.

Not sure what those are.

On 21.11.2003 08:12, skaller wrote:

> But it is much worse. A target can
> depend on itself. Interscript assumes that.
> An example is a Latex build, which depends
> on auxilliary files generated by the build
> [Ocamldoc output can take 4 passes to fixate
> for example].

Well, we are hoping to support those in omake (still work in progress) -

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: