Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
yet another silly question on PXP
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Paul Argentoff <argentoff@r...>
Subject: Re: [Caml-list] yet another silly question on PXP
Dear Paul Argentoff,

Let PA = "Paul Argentoff" in
  written_by PA => 

 PA> But I can't compile it with OCamlMakeFile. Is there any way to do
 PA> that?

Here's the workaround I found:

In the first line of preprocessed file I write (*pp sh *) -- that's
OCamlMakefile standard except that I use as a preprocesssor a custom sh
script which is generated from within Makefile as a .PHONY target. Here's
an example of my Makefile fragment:

PACKS= zip \
       equeue \
       netclient \
       pxp-engine \
       pxp-ulex-utf8 \
       pxp-pp \
       annexlib \
       postgresql \

PPPACKS= netstring \

USE_CAMLP4 = yes
PPLIBS = unix.cma \
	 pcre.cma \
	 netstring.cma \


	echo -n "camlp4o" >
	$(foreach pack, ${PACKS}, echo -n " -I `ocamlfind query ${pack}`" >>;) \
	$(foreach pack, ${PPPACKS}, echo -n " -I `ocamlfind query ${pack}`" >>;) \
	echo -n " -I `ocamlc -where`" >>
	$(foreach lib, ${PPLIBS}, echo -n " ${lib}" >>;) \
	echo -n " "$$\1 >>

The latter part may not seem that elegant, but it's what I could do at last
last night after reading those gnu make manuals...

Yours truly, WBR, Paul Argentoff.