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] canonical camlp4-suffix?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] canonical camlp4-suffix?

On Mon, Sep 03, 2001 at 05:58:40PM +0200, Markus Mottl wrote:

> since I am currently trying to add support for the camlp4-preprocessor
> to OcamlMakefile, I'd like to know what people usually use as suffix
> for files that should be preprocessed.

I generally prefer using ".ml" and ".mli" because some tools of the
compiler does not accept different suffixes (e.g. the debugger). For
the rules, there are two methods:

1/ add in source files comments specifying how compile the file; in the
   Makefiles, call a shell script reading this comment and launching the
   good command; it is the method I use in the sources of Camlp4 (see the
   files tools/Makefile.tpl and tools/ in Camlp4 sources) and
   in GeneWeb (same kind of shell script): this shell just calls ocamlc
   without -pp parameter if the comment is not found.

2/ compile all files with "-pp camlp4o" (or "-pp camlp4r" if you prefer
   the revised syntax) and use "#load" in your files: this has been possible
   (however not yet documented) since some versions of Camlp4. For example,
   if you use to compile "" by:
        ocamlc -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c
   you can add in the beginning of
        #load "pa_extend.cmo";;
        #load "q_MLast.cmo";;
   and compile with
        ocamlc -pp camlp4o -c

   (double semicolons at end of #load are mandatory; in revised syntax
   use simple semicolon)

   You can also use "#directory" in your source files, doing the same
   thing than the option -I of camlp4.

Bug reports:  FAQ:
To unsubscribe, mail  Archives: