forked from colinbenner/ocaml-llvm
/
Makefile
78 lines (55 loc) · 1.57 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
# Makefile for the "num" (exact rational arithmetic) library
include ../../Makefile.config
# Compilation options
CC=$(BYTECC)
CFLAGS=-O -I./bignum/h -I../../byterun $(BYTECCCOMPOPTS)
CAMLC=../../boot/cslrun ../../boot/cslc -I ../../boot
CAMLOPT=../../boot/cslrun ../../cslopt -I ../../stdlib
CAMLOBJS=int_misc.cmo string_misc.cmo nat.cmo big_int.cmo arith_flags.cmo \
ratio.cmo num.cmo arith_status.cmo
CAMLINTF=big_int.cmi nat.cmi num.cmi ratio.cmi arith_status.cmi
COBJS=nat_stubs.o
all: libnums.a nums.cma $(CMIFILES)
allopt: libnums.a nums.cmxa $(CMIFILES)
nums.cma: $(CAMLOBJS)
$(CAMLC) -a -o nums.cma $(CAMLOBJS)
nums.cmxa: $(CAMLOBJS:.cmo=.cmx)
$(CAMLOPT) -a -o nums.cmxa $(CAMLOBJS:.cmo=.cmx)
libnums.a: bignum/libbignum.a $(COBJS)
cp bignum/libbignum.a libnums.a
ar r libnums.a $(COBJS)
$(RANLIB) libnums.a
bignum/libbignum.a:
cd bignum; make $(BIGNUM_ARCH) CC="$(CC)"
install:
cp libnums.a $(LIBDIR)/libnums.a
cd $(LIBDIR); $(RANLIB) libnums.a
cp nums.cma $(CAMLINTF) $(LIBDIR)
installopt:
cp nums.cmxa nums.a $(LIBDIR)
cd $(LIBDIR); $(RANLIB) nums.a
clean:
rm -f *.cm*
realclean: clean
rm -f *.a *.o
rm -f nat.ml int_misc.ml
cd bignum; make scratch
cd test; make clean
.SUFFIXES: .ml .mli .mlp .cmi .cmo .cmx
.mli.cmi:
$(CAMLC) -c $(COMPFLAGS) $<
.ml.cmo:
$(CAMLC) -c $(COMPFLAGS) $<
.ml.cmx:
$(CAMLOPT) -c $(COMPFLAGS) $<
.mlp.ml:
@rm -f $@
$(CPP) $< > $@
@chmod a-w $@
int_misc.ml: int_misc.mlp
nat.ml: nat.mlp
nat_stubs.o: nat.h
depend: nat.ml int_misc.ml
gcc -MM $(CFLAGS) *.c > .depend
../../tools/csldep *.mli *.ml >> .depend
include .depend