summaryrefslogtreecommitdiff
path: root/otherlibs/bigarray/Makefile
blob: ea7173f58f6d644b965992ed1b408374d30a25a2 (plain)
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
#########################################################################
#                                                                       #
#                            Objective Caml                             #
#                                                                       #
#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
#                                                                       #
#   Copyright 1999 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.   #
#                                                                       #
#########################################################################

# $Id$

include ../../config/Makefile

CC=$(BYTECC)
CFLAGS=-I../../byterun -g -O $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS)
CAMLC=../../ocamlcomp.sh -I ../unix
CAMLOPT=../../ocamlcompopt.sh -I ../unix
MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib
COMPFLAGS=-warn-error A

C_OBJS=bigarray_stubs.o mmap_unix.o

CAML_OBJS=bigarray.cmo

all: libbigarray.a bigarray.cma

allopt: libbigarray.a bigarray.cmxa

libbigarray.a: $(C_OBJS)
	$(MKLIB) -o bigarray $(C_OBJS)

bigarray.cma: $(CAML_OBJS)
	$(MKLIB) -ocamlc '$(CAMLC)' -linkall -o bigarray $(CAML_OBJS)

bigarray.cmxa: $(CAML_OBJS:.cmo=.cmx)
	$(MKLIB) -ocamlopt '$(CAMLOPT)' -linkall -o bigarray \
          $(CAML_OBJS:.cmo=.cmx)

install:
	if test -f dllbigarray.so; then cp dllbigarray.so $(LIBDIR)/dllbigarray.so; fi
	cp bigarray.cmi bigarray.mli libbigarray.a bigarray.cma $(LIBDIR)
	cd $(LIBDIR); $(RANLIB) libbigarray.a
	cp bigarray.h $(LIBDIR)/caml/bigarray.h

installopt:
	cp bigarray.a $(CAML_OBJS:.cmo=.cmx) bigarray.cmxa $(LIBDIR)
	cd $(LIBDIR); $(RANLIB) bigarray.a

partialclean:
	rm -f *.cm* 

clean: partialclean
	rm -f libbigarray.* *.o bigarray.a *.so

.SUFFIXES: .ml .mli .cmo .cmi .cmx

.mli.cmi:
	$(CAMLC) -c $(COMPFLAGS) $<

.ml.cmo:
	$(CAMLC) -c $(COMPFLAGS) $<

.ml.cmx:
	$(CAMLOPT) -c $(COMPFLAGS) $<

depend:
	gcc -MM -I../../byterun -I../unix *.c > .depend
	../../boot/ocamlrun ../../tools/ocamldep *.mli *.ml >> .depend

include .depend