1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 01_Makefile_extlib.dpatch by Stephane Glondu <steph@glondu.net>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Use Extlib, add opt, byte and install targets to Makefile
8
diff -urNad trunk~/Makefile trunk/Makefile
9
--- trunk~/Makefile 2006-12-05 23:23:03.000000000 +0100
10
+++ trunk/Makefile 2008-02-07 00:39:04.000000000 +0100
12
# To enable support for Extlib, also uncomment 'open ExtList' at the top
16
+NATIVELIBS := $(if $(wildcard *.cmxa),csv.cmxa csv.a)
17
+OCAMLLIBDIR := $(shell ocamlc -where)
19
#OCAMLCINCS := -package extlib
23
OCAMLDOCFLAGS := -html -stars -sort $(OCAMLCINCS)
25
-all: csv.cma csv.cmxa example csvtool
26
+all: byte opt example
28
+opt: csv.cmxa META csvtool.opt
29
+byte: csv.cma META csvtool.byte
32
ocamlfind ocamlc $(OCAMLCINCS) $(OCAMLCFLAGS) -a -o $@ $^
35
ocamlfind ocamlopt $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) -a -o $@ $^
37
+META: Makefile.config META.in
38
+ sed 's/_VERSION_/$(VERSION)/' META.in > META
40
example: csv.cma example.ml
41
ocamlfind ocamlc $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) $^ -o $@
44
ocamlfind ocamlc $^ -o $@
47
-csvtool: csv.cmxa csvtool.ml
48
+csvtool.opt: csv.cmxa csvtool.ml
49
ocamlfind ocamlopt $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) $^ -o $@
51
+csvtool.byte: csv.cma csvtool.ml
52
+ ocamlfind ocamlc $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) $^ -o $@
54
# Common rules for building OCaml objects.
61
- rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *~ core csvtool example
62
+ -rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *~ core csvtool.byte csvtool.opt example META
68
rm -f .orig-manifest .check-manifest; \
72
+ install -m 0755 -o root -g root -d $(DESTDIR)$(OCAMLLIBDIR)
73
+ ocamlfind install csv -destdir $(DESTDIR)$(OCAMLLIBDIR) META csv.mli csv.cma csv.cmi $(NATIVELIBS)
74
+ install -m 0755 -o root -g root -d $(DESTDIR)$(PREFIX)/bin
75
+ if [ -f csvtool.opt ]; then \
76
+ install -m 0755 -o root -g root csvtool.opt $(DESTDIR)$(PREFIX)/bin/csvtool; \
78
+ install -m 0755 -o root -g root csvtool.byte $(DESTDIR)$(PREFIX)/bin/csvtool; \
81
# Developer documentation (in html/ subdirectory).
86
- -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html csv.ml{i,}
87
+ -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html csv.mli csv.ml
89
-.PHONY: depend dist check-manifest doc
90
+.PHONY: depend dist check-manifest doc all opt byte install
91
diff -urNad trunk~/csv.ml trunk/csv.ml
92
--- trunk~/csv.ml 2006-12-05 23:23:03.000000000 +0100
93
+++ trunk/csv.ml 2008-02-07 00:19:31.000000000 +0100
95
(* Uncomment the next line to enable Extlib's List function. These
96
* avoid stack overflows on really huge CSV files.
101
type t = string list list