caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: Markus Mottl <markus@mail4.ai.univie.ac.at>
Cc: OCAML <caml-list@inria.fr>
Subject: Re: [Caml-list] canonical camlp4-suffix?
Date: Tue, 4 Sep 2001 08:20:37 +0200	[thread overview]
Message-ID: <20010904082037.B27407@verdot.inria.fr> (raw)
In-Reply-To: <20010903175840.A8034@chopin.ai.univie.ac.at>; from markus@mail4.ai.univie.ac.at on Mon, Sep 03, 2001 at 05:58:40PM +0200

Hi,

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/camlp4_comm.sh 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 "foo.ml" by:
        ocamlc -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c foo.ml
   you can add in the beginning of foo.ml:
        #load "pa_extend.cmo";;
        #load "q_MLast.cmo";;
   and compile with
        ocamlc -pp camlp4o -c foo.ml

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

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  parent reply	other threads:[~2001-09-04  6:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-03 15:58 Markus Mottl
2001-09-03 16:31 ` Clement Renard
     [not found] ` <Pine.BSF.3.96.1010903120605.42306B-100000@fledge.watson.org>
2001-09-03 16:36   ` Markus Mottl
     [not found] ` <FLELJKKJEIKNBDJGMIHKGEFKCAAA.franka@cs.uu.nl>
2001-09-03 20:26   ` Markus Mottl
2001-09-04  6:20 ` Daniel de Rauglaudre [this message]
2001-09-04 12:43   ` Markus Mottl
2001-09-04 14:00     ` Daniel de Rauglaudre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010904082037.B27407@verdot.inria.fr \
    --to=daniel.de_rauglaudre@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=markus@mail4.ai.univie.ac.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).