1 #########################################################################
5 # Xavier Leroy, projet Cristal, INRIA Rocquencourt #
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. #
12 #########################################################################
14 # $Id: Makefile 9079 2008-10-08 13:09:39Z doligez $
16 include ../../config/Makefile
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
26 CAML_OBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
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
50 UNIXLIB_OBJS=unix.cmo $(UNIXLIB)/unixLabels.cmo
52 all: libvmthreads.a threads.cma stdlib.cma unix.cma
56 libvmthreads.a: $(C_OBJS)
57 $(MKLIB) -o threads -oc vmthreads $(C_OBJS)
59 threads.cma: $(CAML_OBJS)
60 $(MKLIB) -ocamlc '$(CAMLC)' -o threads -oc vmthreads $(CAML_OBJS)
62 stdlib.cma: $(LIB_OBJS)
63 $(CAMLC) -a -o stdlib.cma $(LIB_OBJS)
65 unix.cma: $(UNIXLIB_OBJS)
66 $(MKLIB) -ocamlc '$(CAMLC)' -o unix -linkall $(UNIXLIB_OBJS)
68 pervasives.cmo: pervasives.mli pervasives.cmi pervasives.ml
69 $(CAMLC) ${COMPFLAGS} -nopervasives -c pervasives.ml
71 pervasives.mli: $(LIB)/pervasives.mli
72 ln -s $(LIB)/pervasives.mli pervasives.mli
74 pervasives.cmi: $(LIB)/pervasives.cmi
75 ln -s $(LIB)/pervasives.cmi pervasives.cmi
77 marshal.cmo: marshal.mli marshal.cmi marshal.ml
78 $(CAMLC) ${COMPFLAGS} -c marshal.ml
80 marshal.mli: $(LIB)/marshal.mli
81 ln -s $(LIB)/marshal.mli marshal.mli
83 marshal.cmi: $(LIB)/marshal.cmi
84 ln -s $(LIB)/marshal.cmi marshal.cmi
86 unix.mli: $(UNIXLIB)/unix.mli
87 ln -s -f $(UNIXLIB)/unix.mli unix.mli
89 unix.cmi: $(UNIXLIB)/unix.cmi
90 ln -s -f $(UNIXLIB)/unix.cmi unix.cmi
92 unix.cmo: unix.mli unix.cmi $(UNIXLIB)/unixLabels.cmo
93 $(CAMLC) ${COMPFLAGS} -c unix.ml
99 rm -f libvmthreads.a dllvmthreads.so *.o
100 rm -f pervasives.mli marshal.mli unix.mli
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
112 .SUFFIXES: .ml .mli .cmo .cmi .cmx
115 $(CAMLC) -c $(COMPFLAGS) $<
118 $(CAMLC) -c $(COMPFLAGS) $<
121 $(CAMLOPT) -c $(COMPFLAGS) $<
124 gcc -MM $(CFLAGS) *.c > .depend
125 ../../boot/ocamlrun ../../tools/ocamldep *.mli *.ml >> .depend