1999-11-17 10:59:06 -08:00
|
|
|
#########################################################################
|
|
|
|
# #
|
2011-07-27 07:17:02 -07:00
|
|
|
# OCaml #
|
1999-11-17 10:59:06 -08:00
|
|
|
# #
|
|
|
|
# Xavier Leroy, projet Cristal, INRIA Rocquencourt #
|
|
|
|
# #
|
|
|
|
# Copyright 1999 Institut National de Recherche en Informatique et #
|
|
|
|
# en Automatique. All rights reserved. This file is distributed #
|
2001-12-07 05:41:02 -08:00
|
|
|
# under the terms of the GNU Library General Public License, with #
|
|
|
|
# the special exception on linking described in file ../../LICENSE. #
|
1999-11-17 10:59:06 -08:00
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
2015-07-17 07:31:05 -07:00
|
|
|
# FIXME reduce redundancy by including ../Makefile
|
|
|
|
|
1996-02-13 08:28:00 -08:00
|
|
|
include ../../config/Makefile
|
2015-07-17 07:31:05 -07:00
|
|
|
CAMLRUN ?= ../../boot/ocamlrun
|
|
|
|
CAMLYACC ?= ../../boot/ocamlyacc
|
1995-10-30 02:21:56 -08:00
|
|
|
|
|
|
|
CC=$(BYTECC)
|
2015-07-17 07:31:05 -07:00
|
|
|
CFLAGS=-I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g
|
2014-04-02 09:20:38 -07:00
|
|
|
ROOTDIR=../..
|
2015-07-17 07:31:05 -07:00
|
|
|
CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc -nostdlib \
|
2014-04-12 03:17:02 -07:00
|
|
|
-I $(ROOTDIR)/stdlib -I $(ROOTDIR)/otherlibs/unix
|
2015-07-17 07:31:05 -07:00
|
|
|
MKLIB=$(CAMLRUN) ../../tools/ocamlmklib
|
|
|
|
COMPFLAGS=-w +33..39 -warn-error A -bin-annot -g -safe-string
|
1995-10-30 02:21:56 -08:00
|
|
|
|
1996-04-03 02:02:34 -08:00
|
|
|
C_OBJS=scheduler.o
|
1995-10-30 02:21:56 -08:00
|
|
|
|
1998-08-08 11:42:22 -07:00
|
|
|
CAML_OBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
|
1996-09-08 08:41:59 -07:00
|
|
|
|
|
|
|
LIB=../../stdlib
|
|
|
|
|
2014-10-15 06:34:58 -07:00
|
|
|
LIB_OBJS=$(LIB)/camlinternalFormatBasics.cmo pervasives.cmo \
|
|
|
|
$(LIB)/array.cmo $(LIB)/list.cmo $(LIB)/char.cmo $(LIB)/bytes.cmo \
|
2014-11-25 05:05:22 -08:00
|
|
|
$(LIB)/string.cmo $(LIB)/sys.cmo $(LIB)/sort.cmo marshal.cmo \
|
2014-10-15 06:34:58 -07:00
|
|
|
$(LIB)/obj.cmo $(LIB)/int32.cmo $(LIB)/int64.cmo \
|
|
|
|
$(LIB)/nativeint.cmo $(LIB)/lexing.cmo $(LIB)/parsing.cmo \
|
|
|
|
$(LIB)/set.cmo $(LIB)/map.cmo $(LIB)/stack.cmo $(LIB)/queue.cmo \
|
|
|
|
$(LIB)/camlinternalLazy.cmo $(LIB)/lazy.cmo $(LIB)/stream.cmo \
|
|
|
|
$(LIB)/buffer.cmo $(LIB)/camlinternalFormat.cmo $(LIB)/printf.cmo \
|
|
|
|
$(LIB)/arg.cmo $(LIB)/printexc.cmo $(LIB)/gc.cmo $(LIB)/digest.cmo \
|
|
|
|
$(LIB)/random.cmo $(LIB)/hashtbl.cmo $(LIB)/format.cmo \
|
|
|
|
$(LIB)/scanf.cmo $(LIB)/callback.cmo $(LIB)/camlinternalOO.cmo \
|
|
|
|
$(LIB)/oo.cmo $(LIB)/camlinternalMod.cmo $(LIB)/genlex.cmo \
|
|
|
|
$(LIB)/weak.cmo $(LIB)/filename.cmo $(LIB)/complex.cmo \
|
|
|
|
$(LIB)/arrayLabels.cmo $(LIB)/listLabels.cmo $(LIB)/bytesLabels.cmo \
|
|
|
|
$(LIB)/stringLabels.cmo $(LIB)/moreLabels.cmo $(LIB)/stdLabels.cmo
|
1996-09-08 08:41:59 -07:00
|
|
|
|
2001-06-25 01:04:00 -07:00
|
|
|
UNIXLIB=../unix
|
|
|
|
|
2001-10-02 08:12:10 -07:00
|
|
|
UNIXLIB_OBJS=unix.cmo $(UNIXLIB)/unixLabels.cmo
|
2001-06-25 01:04:00 -07:00
|
|
|
|
2003-07-17 01:38:28 -07:00
|
|
|
all: libvmthreads.a threads.cma stdlib.cma unix.cma
|
1995-10-30 02:21:56 -08:00
|
|
|
|
1995-11-15 08:40:01 -08:00
|
|
|
allopt:
|
|
|
|
|
2003-07-17 01:38:28 -07:00
|
|
|
libvmthreads.a: $(C_OBJS)
|
|
|
|
$(MKLIB) -o threads -oc vmthreads $(C_OBJS)
|
1995-10-30 02:21:56 -08:00
|
|
|
|
|
|
|
threads.cma: $(CAML_OBJS)
|
2013-11-29 05:04:38 -08:00
|
|
|
$(MKLIB) -ocamlc '$(CAMLC)' -o threads -oc vmthreads $(CAML_OBJS)
|
1995-10-30 02:21:56 -08:00
|
|
|
|
1996-09-08 08:41:59 -07:00
|
|
|
stdlib.cma: $(LIB_OBJS)
|
|
|
|
$(CAMLC) -a -o stdlib.cma $(LIB_OBJS)
|
|
|
|
|
2001-06-25 01:04:00 -07:00
|
|
|
unix.cma: $(UNIXLIB_OBJS)
|
2013-11-29 05:04:38 -08:00
|
|
|
$(MKLIB) -ocamlc '$(CAMLC)' -o unix -linkall $(UNIXLIB_OBJS)
|
2001-06-25 01:04:00 -07:00
|
|
|
|
1996-09-08 08:41:59 -07:00
|
|
|
pervasives.cmo: pervasives.mli pervasives.cmi pervasives.ml
|
2002-01-20 08:30:40 -08:00
|
|
|
$(CAMLC) ${COMPFLAGS} -nopervasives -c pervasives.ml
|
1996-09-08 08:41:59 -07:00
|
|
|
|
|
|
|
pervasives.mli: $(LIB)/pervasives.mli
|
|
|
|
ln -s $(LIB)/pervasives.mli pervasives.mli
|
|
|
|
|
|
|
|
pervasives.cmi: $(LIB)/pervasives.cmi
|
|
|
|
ln -s $(LIB)/pervasives.cmi pervasives.cmi
|
|
|
|
|
2000-07-28 01:49:50 -07:00
|
|
|
marshal.cmo: marshal.mli marshal.cmi marshal.ml
|
2002-01-20 08:30:40 -08:00
|
|
|
$(CAMLC) ${COMPFLAGS} -c marshal.ml
|
2000-07-28 01:49:50 -07:00
|
|
|
|
|
|
|
marshal.mli: $(LIB)/marshal.mli
|
|
|
|
ln -s $(LIB)/marshal.mli marshal.mli
|
|
|
|
|
|
|
|
marshal.cmi: $(LIB)/marshal.cmi
|
|
|
|
ln -s $(LIB)/marshal.cmi marshal.cmi
|
|
|
|
|
2007-02-16 01:54:55 -08:00
|
|
|
unix.mli: $(UNIXLIB)/unix.mli
|
2008-10-08 06:09:39 -07:00
|
|
|
ln -s -f $(UNIXLIB)/unix.mli unix.mli
|
2007-02-16 01:54:55 -08:00
|
|
|
|
|
|
|
unix.cmi: $(UNIXLIB)/unix.cmi
|
2008-10-08 06:09:39 -07:00
|
|
|
ln -s -f $(UNIXLIB)/unix.cmi unix.cmi
|
2007-02-16 01:54:55 -08:00
|
|
|
|
2007-10-09 03:29:37 -07:00
|
|
|
unix.cmo: unix.mli unix.cmi $(UNIXLIB)/unixLabels.cmo
|
2002-01-20 08:30:40 -08:00
|
|
|
$(CAMLC) ${COMPFLAGS} -c unix.ml
|
2001-06-25 01:04:00 -07:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean:
|
|
|
|
rm -f *.cm*
|
1995-10-30 02:21:56 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
clean: partialclean
|
2003-07-17 01:38:28 -07:00
|
|
|
rm -f libvmthreads.a dllvmthreads.so *.o
|
2001-06-25 01:04:00 -07:00
|
|
|
rm -f pervasives.mli marshal.mli unix.mli
|
1995-11-27 04:53:17 -08:00
|
|
|
|
2014-04-07 00:06:17 -07:00
|
|
|
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
|
|
|
|
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
|
|
|
|
|
1995-10-30 02:21:56 -08:00
|
|
|
install:
|
2014-04-07 00:06:17 -07:00
|
|
|
if test -f dllvmthreads.so; then cp dllvmthreads.so $(INSTALL_STUBLIBDIR)/.; fi
|
|
|
|
mkdir -p $(INSTALL_LIBDIR)/vmthreads
|
|
|
|
cp libvmthreads.a $(INSTALL_LIBDIR)/vmthreads/libvmthreads.a
|
|
|
|
cd $(INSTALL_LIBDIR)/vmthreads; $(RANLIB) libvmthreads.a
|
2013-09-04 08:12:37 -07:00
|
|
|
cp thread.cmi mutex.cmi condition.cmi event.cmi threadUnix.cmi \
|
2014-04-07 00:06:17 -07:00
|
|
|
threads.cma stdlib.cma unix.cma $(INSTALL_LIBDIR)/vmthreads
|
2013-09-04 08:12:37 -07:00
|
|
|
cp thread.mli mutex.mli condition.mli event.mli threadUnix.mli \
|
2014-04-07 00:06:17 -07:00
|
|
|
$(INSTALL_LIBDIR)/vmthreads
|
1995-10-30 02:21:56 -08:00
|
|
|
|
1995-11-15 08:40:01 -08:00
|
|
|
installopt:
|
|
|
|
|
1995-10-30 02:21:56 -08:00
|
|
|
.SUFFIXES: .ml .mli .cmo .cmi .cmx
|
|
|
|
|
|
|
|
.mli.cmi:
|
|
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
|
|
|
|
.ml.cmo:
|
2001-06-25 01:04:00 -07:00
|
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
1995-10-30 02:21:56 -08:00
|
|
|
|
|
|
|
depend:
|
2015-01-20 09:02:26 -08:00
|
|
|
$(CC) -MM $(CFLAGS) *.c > .depend
|
2015-07-17 07:31:05 -07:00
|
|
|
$(CAMLRUN) ../../tools/ocamldep *.mli *.ml >> .depend
|
1995-10-30 02:21:56 -08:00
|
|
|
|
|
|
|
include .depend
|