-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
88 lines (66 loc) · 2.4 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#########################################################################
# #
# CamlDBM #
# #
# Xavier Leroy, projet Gallium, INRIA Rocquencourt #
# #
# Copyright 2011 Institut National de Recherche en Informatique et #
# en Automatique. All rights reserved. This file is distributed #
# under the terms of the GNU Library General Public License, with #
# the special exception on linking described in file ../../LICENSE. #
# #
#########################################################################
include Makefile.config
OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLMKLIB=ocamlmklib
OCAMLDEP=ocamldep
OCAMLRUN=ocamlrun
O=o
A=a
SO=so
LIBDIR=`ocamlc -where`
STUBLIBDIR=$(LIBDIR)/stublibs
all: libcamldbm.$(A) dbm.cma dbm.cmxa dbm.cmxs
dbm.cma: dbm.cmo
$(OCAMLMKLIB) -o dbm -oc camldbm -linkall dbm.cmo $(DBM_LINK)
dbm.cmxa: dbm.cmx
$(OCAMLMKLIB) -o dbm -oc camldbm -linkall dbm.cmx $(DBM_LINK)
dbm.cmxs: dbm.cmxa libcamldbm.$(A)
$(OCAMLOPT) -shared -o dbm.cmxs -I . dbm.cmxa
libcamldbm.$(A): cldbm.$(O)
$(OCAMLMKLIB) -oc camldbm cldbm.$(O) $(DBM_LINK)
.SUFFIXES: .ml .mli .cmi .cmo .cmx .$(O)
.mli.cmi:
$(OCAMLC) -c $(COMPFLAGS) $<
.ml.cmo:
$(OCAMLC) -c $(COMPFLAGS) $<
.ml.cmx:
$(OCAMLOPT) -c $(COMPFLAGS) $<
.c.$(O):
$(OCAMLC) -c -ccopt "$(DBM_INCLUDE)" -ccopt "$(DBM_DEFINES)" $<
depend:
$(OCAMLDEP) *.ml *.mli > .depend
install::
if test -f dllcamldbm.$(SO); then cp dllcamldbm.$(SO) $(STUBLIBDIR)/; fi
cp libcamldbm.$(A) $(LIBDIR)/
cd $(LIBDIR) && ranlib libcamldbm.$(A)
cp dbm.cma dbm.cmxa dbm.cmi dbm.mli $(LIBDIR)/
cp dbm.$(A) $(LIBDIR)/
cd $(LIBDIR) && ranlib dbm.$(A)
if test -f dbm.cmxs; then cp dbm.cmxs $(LIBDIR)/; fi
clean::
rm -f *.cm* *.$(O) *.$(A) *.$(SO)
testdbm.byte: dbm.cma testdbm.ml
$(OCAMLC) -o $@ dbm.cma testdbm.ml
testdbm.opt: dbm.cmxa testdbm.ml
$(OCAMLOPT) -ccopt -L. -o $@ dbm.cmxa testdbm.ml
clean::
rm -f testdbm.byte testdbm.opt testdatabase.*
test: testdbm.byte testdbm.opt
rm -f testdatabase.*
ocamlrun -I . ./testdbm.byte
rm -f testdatabase.*
./testdbm.opt
rm -f testdatabase.*
include .depend