]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/ocaml/contrib/otherlibs/threads/Makefile
Update
[l4.git] / l4 / pkg / ocaml / ocaml / contrib / otherlibs / threads / Makefile
1 #########################################################################
2 #                                                                       #
3 #                            Objective Caml                             #
4 #                                                                       #
5 #            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
6 #                                                                       #
7 #   Copyright 1999 Institut National de Recherche en Informatique et    #
8 #   en Automatique.  All rights reserved.  This file is distributed     #
9 #   under the terms of the GNU Library General Public License, with     #
10 #   the special exception on linking described in file ../../LICENSE.   #
11 #                                                                       #
12 #########################################################################
13
14 # $Id: Makefile 9079 2008-10-08 13:09:39Z doligez $
15
16 include ../../config/Makefile
17
18 CC=$(BYTECC)
19 CFLAGS=-I../../byterun -O $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g
20 CAMLC=../../ocamlcomp.sh -I ../unix
21 MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib
22 COMPFLAGS=-warn-error A
23
24 C_OBJS=scheduler.o
25
26 CAML_OBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
27
28 LIB=../../stdlib
29
30 LIB_OBJS=pervasives.cmo \
31   $(LIB)/array.cmo $(LIB)/list.cmo $(LIB)/char.cmo $(LIB)/string.cmo \
32   $(LIB)/sys.cmo $(LIB)/hashtbl.cmo $(LIB)/sort.cmo \
33   marshal.cmo $(LIB)/obj.cmo $(LIB)/int32.cmo $(LIB)/int64.cmo \
34   $(LIB)/nativeint.cmo \
35   $(LIB)/lexing.cmo $(LIB)/parsing.cmo \
36   $(LIB)/set.cmo $(LIB)/map.cmo $(LIB)/stack.cmo $(LIB)/queue.cmo \
37   $(LIB)/camlinternalLazy.cmo $(LIB)/lazy.cmo \
38   $(LIB)/stream.cmo $(LIB)/buffer.cmo \
39   $(LIB)/printf.cmo $(LIB)/format.cmo \
40   $(LIB)/scanf.cmo $(LIB)/arg.cmo \
41   $(LIB)/printexc.cmo $(LIB)/gc.cmo $(LIB)/digest.cmo $(LIB)/random.cmo \
42   $(LIB)/camlinternalOO.cmo $(LIB)/oo.cmo $(LIB)/camlinternalMod.cmo \
43   $(LIB)/genlex.cmo $(LIB)/callback.cmo $(LIB)/weak.cmo \
44   $(LIB)/filename.cmo $(LIB)/complex.cmo \
45   $(LIB)/arrayLabels.cmo $(LIB)/listLabels.cmo $(LIB)/stringLabels.cmo \
46   $(LIB)/stdLabels.cmo $(LIB)/moreLabels.cmo
47
48 UNIXLIB=../unix
49
50 UNIXLIB_OBJS=unix.cmo $(UNIXLIB)/unixLabels.cmo
51
52 all: libvmthreads.a threads.cma stdlib.cma unix.cma
53
54 allopt:
55
56 libvmthreads.a: $(C_OBJS)
57         $(MKLIB) -o threads -oc vmthreads $(C_OBJS)
58
59 threads.cma: $(CAML_OBJS)
60         $(MKLIB) -ocamlc '$(CAMLC)' -o threads -oc vmthreads $(CAML_OBJS)
61
62 stdlib.cma: $(LIB_OBJS)
63         $(CAMLC) -a -o stdlib.cma $(LIB_OBJS)
64
65 unix.cma: $(UNIXLIB_OBJS)
66         $(MKLIB) -ocamlc '$(CAMLC)' -o unix -linkall $(UNIXLIB_OBJS)
67
68 pervasives.cmo: pervasives.mli pervasives.cmi pervasives.ml
69         $(CAMLC) ${COMPFLAGS} -nopervasives -c pervasives.ml
70
71 pervasives.mli: $(LIB)/pervasives.mli
72         ln -s $(LIB)/pervasives.mli pervasives.mli
73
74 pervasives.cmi: $(LIB)/pervasives.cmi
75         ln -s $(LIB)/pervasives.cmi pervasives.cmi
76
77 marshal.cmo: marshal.mli marshal.cmi marshal.ml
78         $(CAMLC) ${COMPFLAGS} -c marshal.ml
79
80 marshal.mli: $(LIB)/marshal.mli
81         ln -s $(LIB)/marshal.mli marshal.mli
82
83 marshal.cmi: $(LIB)/marshal.cmi
84         ln -s $(LIB)/marshal.cmi marshal.cmi
85
86 unix.mli: $(UNIXLIB)/unix.mli
87         ln -s -f $(UNIXLIB)/unix.mli unix.mli
88
89 unix.cmi: $(UNIXLIB)/unix.cmi
90         ln -s -f $(UNIXLIB)/unix.cmi unix.cmi
91
92 unix.cmo: unix.mli unix.cmi $(UNIXLIB)/unixLabels.cmo
93         $(CAMLC) ${COMPFLAGS} -c unix.ml
94
95 partialclean:
96         rm -f *.cm*
97
98 clean: partialclean
99         rm -f libvmthreads.a dllvmthreads.so *.o
100         rm -f pervasives.mli marshal.mli unix.mli
101
102 install:
103         if test -f dllvmthreads.so; then cp dllvmthreads.so $(STUBLIBDIR)/.; fi
104         mkdir -p $(LIBDIR)/vmthreads
105         cp libvmthreads.a $(LIBDIR)/vmthreads/libvmthreads.a
106         cd $(LIBDIR)/vmthreads; $(RANLIB) libvmthreads.a
107         cp thread.cmi mutex.cmi condition.cmi event.cmi threadUnix.cmi threads.cma stdlib.cma unix.cma $(LIBDIR)/vmthreads
108         cp thread.mli mutex.mli condition.mli event.mli threadUnix.mli $(LIBDIR)/vmthreads
109
110 installopt:
111
112 .SUFFIXES: .ml .mli .cmo .cmi .cmx
113
114 .mli.cmi:
115         $(CAMLC) -c $(COMPFLAGS) $<
116
117 .ml.cmo:
118         $(CAMLC) -c $(COMPFLAGS) $<
119
120 .ml.cmx:
121         $(CAMLOPT) -c $(COMPFLAGS) $<
122
123 depend:
124         gcc -MM $(CFLAGS) *.c > .depend
125         ../../boot/ocamlrun ../../tools/ocamldep *.mli *.ml >> .depend
126
127 include .depend