Version française
Home     About     Download     Resources     Contact us    
Browse thread
ocamlfind + ocamldep + camlp4?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin_jambon@e...>
Subject: Re: [Caml-list] ocamlfind + ocamldep + camlp4?
On Tue, 6 Dec 2005, Gerd Stolpmann wrote:

> Am Montag, den 05.12.2005, 14:08 -0800 schrieb Martin Jambon:
>> Hello,
>>
>> I would like to know if there is a way of using ocamlfind as front-end to
>> camlp4o alone. Let me explain: the following works nicely since it will
>> locate the pa_someext package and load its dependencies:
>>
>>    ocamlfind ocamlc -c -syntax camlp4o -package pa_someext file.ml
>>
>> but how to tell ocamldep to preprocess file.ml using camlp4o and the
>> wanted syntax modules, without listing all the include directories and
>> dependencies?
>
> Why not
>
> ocamlfind ocamldep -syntax camlp4o -package pa_someext *.ml
>
> ?
>
> You can also get the options for camlp4o using:
>
> P4_PKG = "pa_someext"
> P4_I_OPTIONS = $(shell ocamlfind query -predicates "syntax,preprocessor,camlp4o" \
>                 $(P4_PKG) -i-format)
> P4_A_OPTIONS = $(shell ocamlfind query -predicates "syntax,preprocessor,camlp4o" \
>                 $(P4_PKG) -a-format)
>
> then
>
> camlp4 $(P4_I_OPTIONS) $(P4_A_OPTIONS)
>
> should work.

Thanks a lot Gerd (and Alain).

I was really looking for a simple way of performing source-to-source 
conversion of OCaml code, from the command-line. So that really helps, and 
I derived a shell-script which provides such a command:
   http://martin.jambon.free.fr/camlp4find



Martin

--
Martin Jambon, PhD
http://martin.jambon.free.fr

Store and share your bioinformatics tips at http://wikiomics.org