English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2005-02-25 (07:35)
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 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 \


.PHONY: pp.sh

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

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.
Jabber:	paul@jabber.rtelekom.ru