From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA27780; Tue, 4 Sep 2001 08:20:40 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA27486 for ; Tue, 4 Sep 2001 08:20:39 +0200 (MET DST) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f846KbL21967; Tue, 4 Sep 2001 08:20:37 +0200 (MET DST) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id IAA27548; Tue, 4 Sep 2001 08:20:37 +0200 Date: Tue, 4 Sep 2001 08:20:37 +0200 From: Daniel de Rauglaudre To: Markus Mottl Cc: OCAML Subject: Re: [Caml-list] canonical camlp4-suffix? Message-ID: <20010904082037.B27407@verdot.inria.fr> References: <20010903175840.A8034@chopin.ai.univie.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0us 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 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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