-# $Id: Makefile,v 1.9 2006-10-01 13:06:04 rich Exp $
+# $Id: Makefile,v 1.10 2006-11-24 09:43:15 rich Exp $
-PACKAGE := ocaml-csv
-VERSION := 1.1.2
+include Makefile.config
+
+# To enable support for Extlib, also uncomment 'open ExtList' at the top
+# of file csv.ml.
-OCAMLC := ocamlc
OCAMLCINCS :=
-OCAMLCFLAGS := -w s -g
+#OCAMLCINCS := -package extlib
+OCAMLCFLAGS := -g
OCAMLCLIBS :=
+#OCAMLCLIBS := -linkpkg
-OCAMLOPT := ocamlopt
OCAMLOPTINCS := $(OCAMLCINCS)
-OCAMLOPTFLAGS := -w s
+OCAMLOPTFLAGS :=
OCAMLOPTLIBS :=
+#OCAMLOPTLIBS := -linkpkg
OBJS := csv.cmo
XOBJS := $(OBJS:.cmo=.cmx)
all: csv.cma csv.cmxa example csvtool
csv.cma: $(OBJS)
- $(OCAMLC) $(OCAMLCFLAGS) -a -o $@ $^
+ ocamlfind ocamlc $(OCAMLCINCS) $(OCAMLCFLAGS) -a -o $@ $^
csv.cmxa: $(XOBJS)
- $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $@ $^
+ ocamlfind ocamlopt $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) -a -o $@ $^
example: csv.cma example.ml
- $(OCAMLC) $^ -o $@
+ ocamlfind ocamlc $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) $^ -o $@
test: csv.cma test.ml
- $(OCAMLC) $^ -o $@
+ ocamlfind ocamlc $^ -o $@
./test
csvtool: csv.cmxa csvtool.ml
- $(OCAMLOPT) $^ -o $@
+ ocamlfind ocamlopt $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) $^ -o $@
# Common rules for building OCaml objects.
.mli.cmi:
- $(OCAMLC) $(OCAMLCFLAGS) $(OCAMLCINCS) -c $<
+ ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) -c $<
.ml.cmo:
- $(OCAMLC) $(OCAMLCFLAGS) $(OCAMLCINCS) -c $<
+ ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) -c $<
.ml.cmx:
- $(OCAMLOPT) $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) -c $<
+ ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) -c $<
.SUFFIXES: .cmo .cmi .cmx .ml .mli
(* csv.ml - comma separated values parser
*
- * $Id: csv.ml,v 1.12 2006-10-18 14:56:12 rich Exp $
+ * $Id: csv.ml,v 1.13 2006-11-24 09:43:15 rich Exp $
*)
(* The format of CSV files:
open Printf
+(* Uncomment the next line to enable Extlib's List function. These
+ * avoid stack overflows on really huge CSV files.
+ *)
+(*open ExtList*)
+
type t = string list list
exception Bad_CSV_file of string