On Wed, 4 Apr 2007, Martin DeMello wrote:
> I've adapted Dave Benjamin's notes into a quick tutorial on the wiki:
> http://www.ocaml-tutorial.org/ledit
Nice, thanks! I also got it to compile using OCamlMakefile - here's the
Makefile I used:
OCAMLMAKEFILE = OCamlMakefile
RESULT = ledit
SOURCES = cursor.mli cursor.ml ledit.mli ledit.ml
PRE_TARGETS = pa_local.cmo
USE_CAMLP4 = yes
LIBS = unix
all: byte-code-library native-code-library
include $(OCAMLMAKEFILE)
I had to add a few preprocessor hints to the source code for this to work.
To the top of cursor.ml, cursor.mli, and
ledit.mli, I added:
(*pp camlp4r *)
(*pp camlp4r *)
(*pp camlp4r *)
To the top of ledit.ml:
(*pp camlp4r ./pa_local.cmo *)
And to the top of pa_local.ml:
(*pp camlp4r pa_extend.cmo q_MLast.cmo -loc loc *)
With this setup, a simple "make" will build ledit.cma and ledit.cmxa.
OCamlMakefile is available here:
http://www.ocaml.info/home/ocaml_sources.html#toc16
I'll try to find time tonight to make an account on the Wiki.
Cheers,
Dave
.