summaryrefslogtreecommitdiff
path: root/otherlibs/bigarray/Makefile.nt
blob: b4a8dc30587d79da1f4b612637cb1d8818cc9fa3 (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
75
76
77
78
79
80
81
82
83
84
#########################################################################
#                                                                       #
#                            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 -I../win32unix -DIN_OCAML_BIGARRAY
CAMLC=../../boot/ocamlrun ../../ocamlc -I ../../stdlib -I ../win32unix
CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib -I ../win32unix

C_OBJS=bigarray_stubs.obj mmap_win32.obj

CAML_OBJS=bigarray.cmo

all: dllbigarray.dll libbigarray.$(A) bigarray.cma

allopt: libbigarray.$(A) bigarray.cmxa

dllbigarray.dll: $(C_OBJS:.obj=.$(DO))
	$(call MKDLL,dllbigarray.dll,dllbigarray.$(A),\
	  $(C_OBJS:.obj=.$(DO)) ../../byterun/ocamlrun.$(A))

libbigarray.$(A): $(C_OBJS:.obj=.$(SO))
	$(call MKLIB,libbigarray.$(A),$(C_OBJS:.obj=.$(SO)))

bigarray.cma: $(CAML_OBJS)
	$(CAMLC) -a -linkall -o bigarray.cma $(CAML_OBJS) \
           -dllib -lbigarray -cclib -lbigarray

bigarray.cmxa: $(CAML_OBJS:.cmo=.cmx)
	$(CAMLOPT) -a -linkall -o bigarray.cmxa \
           $(CAML_OBJS:.cmo=.cmx) -cclib -lbigarray

install:
	cp dllbigarray.dll $(STUBLIBDIR)
	cp libbigarray.$(A) dllbigarray.$(A) $(LIBDIR)
	cp bigarray.cmi bigarray.mli bigarray.cma $(LIBDIR)
	cp bigarray.h $(LIBDIR)/caml/bigarray.h

installopt:
	cp bigarray.$(A) $(CAML_OBJS:.cmo=.cmx) bigarray.cmxa $(LIBDIR)

partialclean:
	rm -f *.cm*

clean: partialclean
	rm -f *.dll *.$(A) *.$(O)

.SUFFIXES: .ml .mli .cmo .cmi .cmx .$(DO) .$(SO)

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

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

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

.c.$(DO):
	$(BYTECC) $(DLLCCCOMPOPTS) $(CFLAGS) -c $<
	mv $*.$(O) $*.$(DO)

.c.$(SO):
	$(BYTECC) $(BYTECCCOMPOPTS) $(CFLAGS) -c $<
	mv $*.$(O) $*.$(SO)

depend:
	gcc -MM $(CFLAGS) *.c > .depend
	../../boot/ocamlrun ../../tools/ocamldep *.mli *.ml >> .depend

include .depend