~ubuntu-branches/ubuntu/trusty/ocaml-csv/trusty

« back to all changes in this revision

Viewing changes to debian/patches/01_Makefile_extlib.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Stephane Glondu
  • Date: 2008-02-07 02:36:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080207023622-dfik4jt3v5jnj38a
Tags: 1.1.6-3
* Fix 01_Makefile_extlib.dpatch to handle architectures where
  native code is not available.
* Fix debian/watch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 01_Makefile_extlib.dpatch by Stephane Glondu <steph@glondu.net>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Use Extlib, add opt, byte and install targets to Makefile
 
6
 
 
7
@DPATCH@
 
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
 
11
@@ -5,6 +5,9 @@
 
12
 # To enable support for Extlib, also uncomment 'open ExtList' at the top
 
13
 # of file csv.ml.
 
14
 
 
15
+PREFIX         := /usr/local
 
16
+NATIVELIBS     := $(if $(wildcard *.cmxa),csv.cmxa csv.a)
 
17
+OCAMLLIBDIR    := $(shell ocamlc -where)
 
18
 OCAMLCINCS     :=
 
19
 #OCAMLCINCS    := -package extlib
 
20
 OCAMLCFLAGS    := -g
 
21
@@ -21,7 +24,10 @@
 
22
 
 
23
 OCAMLDOCFLAGS := -html -stars -sort $(OCAMLCINCS)
 
24
 
 
25
-all: csv.cma csv.cmxa example csvtool
 
26
+all: byte opt example
 
27
+
 
28
+opt: csv.cmxa META csvtool.opt
 
29
+byte: csv.cma META csvtool.byte
 
30
 
 
31
 csv.cma: $(OBJS)
 
32
        ocamlfind ocamlc $(OCAMLCINCS) $(OCAMLCFLAGS) -a -o $@ $^
 
33
@@ -29,6 +35,9 @@
 
34
 csv.cmxa: $(XOBJS)
 
35
        ocamlfind ocamlopt $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) -a -o $@ $^
 
36
 
 
37
+META: Makefile.config META.in
 
38
+       sed 's/_VERSION_/$(VERSION)/' META.in > META
 
39
+
 
40
 example: csv.cma example.ml
 
41
        ocamlfind ocamlc $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) $^ -o $@
 
42
 
 
43
@@ -36,9 +45,12 @@
 
44
        ocamlfind ocamlc $^ -o $@
 
45
        ./test
 
46
 
 
47
-csvtool: csv.cmxa csvtool.ml
 
48
+csvtool.opt: csv.cmxa csvtool.ml
 
49
        ocamlfind ocamlopt $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) $^ -o $@
 
50
 
 
51
+csvtool.byte: csv.cma csvtool.ml
 
52
+       ocamlfind ocamlc $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) $^ -o $@
 
53
+
 
54
 # Common rules for building OCaml objects.
 
55
 
 
56
 .mli.cmi:
 
57
@@ -53,7 +65,8 @@
 
58
 # Clean.
 
59
 
 
60
 clean:
 
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
 
63
+       -rm -Rf html
 
64
 
 
65
 # Dependencies.
 
66
 
 
67
@@ -90,11 +103,21 @@
 
68
        rm -f .orig-manifest .check-manifest; \
 
69
        exit $$rv
 
70
 
 
71
+install:
 
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; \
 
77
+       else \
 
78
+         install -m 0755 -o root -g root csvtool.byte $(DESTDIR)$(PREFIX)/bin/csvtool; \
 
79
+       fi
 
80
+
 
81
 # Developer documentation (in html/ subdirectory).
 
82
 
 
83
 doc:
 
84
        rm -rf html
 
85
        mkdir html
 
86
-       -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html csv.ml{i,}
 
87
+       -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html csv.mli csv.ml
 
88
 
 
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
 
94
@@ -45,7 +45,7 @@
 
95
 (* Uncomment the next line to enable Extlib's List function.  These
 
96
  * avoid stack overflows on really huge CSV files.
 
97
  *)
 
98
-(*open ExtList*)
 
99
+open ExtList
 
100
 
 
101
 type t = string list list
 
102