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 OAA00002; Tue, 4 Sep 2001 14:43:39 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA00169 for ; Tue, 4 Sep 2001 14:43:37 +0200 (MET DST) Received: from chopin.ai.univie.ac.at (chopin.ai.univie.ac.at [131.130.174.170]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f84Chaf09512; Tue, 4 Sep 2001 14:43:36 +0200 (MET DST) Received: (from markus@localhost) by chopin.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id OAA10254; Tue, 4 Sep 2001 14:43:35 +0200 Date: Tue, 4 Sep 2001 14:43:35 +0200 From: Markus Mottl To: Daniel de Rauglaudre Cc: OCAML Subject: Re: [Caml-list] canonical camlp4-suffix? Message-ID: <20010904144335.B9377@chopin.ai.univie.ac.at> References: <20010903175840.A8034@chopin.ai.univie.ac.at> <20010904082037.B27407@verdot.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010904082037.B27407@verdot.inria.fr>; from daniel.de_rauglaudre@inria.fr on Tue, Sep 04, 2001 at 08:20:37 +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 04 Sep 2001, Daniel de Rauglaudre wrote: > On Mon, Sep 03, 2001 at 05:58:40PM +0200, Markus Mottl wrote: 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: Thanks, this is important to know! I don't want to have nasty side effects when using a non-standard suffix so I'll stay with ".ml" and ".mli" and scan the file for suitable preprocessing options. > 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. Ok, I had something like this in mind. Good to know where to find an example implementation. > 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, Nice! Though, if I already have to check for a preprocessing tag anyway, I could also do things as follows: The topmost line in a file could read like this: (*pp camlp4o -I some_dir some_quots.cmo some_more_quots.cmo *) Then I just check for the 'pp' tag, and if it's there, I just take the contents of the comment as parameter for the -pp option. This could then also be a completely different preprocessor (cpp? ;). Please tell me, if there is any hidden catch with this approach. Thanks for the hints! Regards, Markus Mottl -- Markus Mottl markus@oefai.at Austrian Research Institute for Artificial Intelligence http://www.oefai.at/~markus ------------------- 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