Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] OASIS help : adding -pp camlp4of and camlp4.gramlib to the compilation flags

19 views
Skip to first unread message

Francois Berenger

unread,
Jan 16, 2012, 9:51:57 PM1/16/12
to caml...@yquem.inria.fr, ocaml_b...@yahoogroups.com
Hello,

I'd like to preprocess some source files.
Gabriel Scherer advised me to use the options
mentioned in the title of this e-mail.

What should I modify in an oasis project in order to
add these compilation flags?

I guess something should be added to the _oasis file.
I did not find anything in the oasis documentation about
using a preprocessor.

Here is an example build command that works, issued
by a Makefile for the moment:

ocamlfind ocamlopt -package camlp4.gramlib,batteries -linkpkg -o
test_logger -annot -g -pp camlp4of logger.ml test_logger.ml

Thanks a lot,
Francois.


--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Francois Berenger

unread,
Jan 17, 2012, 2:48:41 AM1/17/12
to caml...@yquem.inria.fr, ocaml_b...@yahoogroups.com
On 01/17/2012 11:51 AM, Francois Berenger wrote:
> Hello,
>
> I'd like to preprocess some source files.
> Gabriel Scherer advised me to use the options
> mentioned in the title of this e-mail.
>
> What should I modify in an oasis project in order to
> add these compilation flags?
>
> I guess something should be added to the _oasis file.
> I did not find anything in the oasis documentation about
> using a preprocessor.
>
> Here is an example build command that works, issued
> by a Makefile for the moment:
>
> ocamlfind ocamlopt -package camlp4.gramlib,batteries -linkpkg -o
> test_logger -annot -g -pp camlp4of logger.ml test_logger.ml

In fact, now I only need to use cppo to preprocess my source files.
So the updated command is:
ocamlfind ocamlopt -package batteries -linkpkg -o test_logger -annot -g
-pp cppo logger.ml test_logger.ml

How do I request oasis to preprocess all files using cppo?

Jérémie Dimino

unread,
Jan 17, 2012, 3:32:33 AM1/17/12
to Francois Berenger, caml...@yquem.inria.fr, ocaml_b...@yahoogroups.com
Le mardi 17 janvier 2012 à 16:48 +0900, Francois Berenger a écrit :
> In fact, now I only need to use cppo to preprocess my source files.
> So the updated command is:
> ocamlfind ocamlopt -package batteries -linkpkg -o test_logger -annot -g
> -pp cppo logger.ml test_logger.ml
>
> How do I request oasis to preprocess all files using cppo?

You must modify the _tags file. You can add this line (outside
OASIS_START/OASIS_STOP):

<**/*.ml>: pp(cppo)

you may also want to add:

BuildTools: cppo

to your _oasis file so oasis will check for cppo.

Cheers,

--
Jérémie

Francois Berenger

unread,
Jan 17, 2012, 4:26:24 AM1/17/12
to caml...@inria.fr
On 01/17/2012 05:32 PM, Jérémie Dimino wrote:
> Le mardi 17 janvier 2012 à 16:48 +0900, Francois Berenger a écrit :
>> In fact, now I only need to use cppo to preprocess my source files.
>> So the updated command is:
>> ocamlfind ocamlopt -package batteries -linkpkg -o test_logger -annot -g
>> -pp cppo logger.ml test_logger.ml
>>
>> How do I request oasis to preprocess all files using cppo?
>
> You must modify the _tags file. You can add this line (outside
> OASIS_START/OASIS_STOP):
>
> <**/*.ml>: pp(cppo)
>
> you may also want to add:
>
> BuildTools: cppo
>
> to your _oasis file so oasis will check for cppo.

Thanks a lot! You made my day. :)
0 new messages