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
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
include ../../config/Makefile
|
2015-07-17 07:31:05 -07:00
|
|
|
CAMLRUN ?= ../../boot/ocamlrun
|
|
|
|
CAMLYACC ?= ../../boot/ocamlyacc
|
1996-09-04 07:17:43 -07:00
|
|
|
|
|
|
|
# Compilation options
|
2015-07-17 07:31:05 -07:00
|
|
|
CAMLC=$(CAMLRUN) ../../ocamlc -I ../../stdlib -I ../win32unix
|
|
|
|
CAMLOPT=$(CAMLRUN) ../../ocamlopt -I ../../stdlib -I ../win32unix
|
2012-05-29 04:10:03 -07:00
|
|
|
COMPFLAGS=-w +33 -warn-error A -g
|
2015-07-17 07:31:05 -07:00
|
|
|
MKLIB=$(CAMLRUN) ../../tools/ocamlmklib
|
2007-11-06 07:16:56 -08:00
|
|
|
CFLAGS=-I../../byterun $(EXTRACFLAGS)
|
1996-09-04 07:17:43 -07:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
CAMLOBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
|
|
|
|
CMIFILES=$(CAMLOBJS:.cmo=.cmi)
|
2010-04-27 00:55:08 -07:00
|
|
|
COBJS=st_stubs_b.$(O)
|
|
|
|
COBJS_NAT=st_stubs_n.$(O)
|
1996-09-09 05:25:20 -07:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
LIBNAME=threads
|
1996-09-04 07:17:43 -07:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
all: lib$(LIBNAME).$(A) $(LIBNAME).cma $(CMIFILES)
|
1996-09-04 07:17:43 -07:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
allopt: lib$(LIBNAME).$(A) $(LIBNAME).cmxa $(LIBNAME).cmxs $(CMIFILES)
|
2001-08-28 07:47:48 -07:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
$(LIBNAME).cma: $(CAMLOBJS)
|
2015-07-17 07:31:05 -07:00
|
|
|
$(MKLIB) -o $(LIBNAME) -ocamlc "$(CAMLRUN) ../../ocamlc" \
|
2013-09-04 08:12:37 -07:00
|
|
|
-linkall $(CAMLOBJS) $(LINKOPTS)
|
2001-08-28 07:47:48 -07:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
lib$(LIBNAME).$(A): $(COBJS)
|
|
|
|
$(MKLIB) -o $(LIBNAME) $(COBJS) $(LDOPTS)
|
1996-09-09 05:25:20 -07:00
|
|
|
|
2010-04-27 00:55:08 -07:00
|
|
|
st_stubs_b.$(O): st_stubs.c st_win32.h
|
|
|
|
$(BYTECC) $(BYTECCCOMPOPTS) $(CFLAGS) -c st_stubs.c
|
|
|
|
mv st_stubs.$(O) st_stubs_b.$(O)
|
1996-09-09 05:25:20 -07:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
|
|
|
|
|
|
|
|
$(LIBNAME).cmxa: $(CAMLOBJS:.cmo=.cmx)
|
2013-09-04 08:12:37 -07:00
|
|
|
$(MKLIB) -o $(LIBNAME)nat \
|
2015-07-17 07:31:05 -07:00
|
|
|
-ocamlopt "$(CAMLRUN) ../../ocamlopt" -linkall \
|
2013-09-04 08:12:37 -07:00
|
|
|
$(CAMLOBJS:.cmo=.cmx) $(LINKOPTS)
|
2007-11-06 07:16:56 -08:00
|
|
|
mv $(LIBNAME)nat.cmxa $(LIBNAME).cmxa
|
|
|
|
mv $(LIBNAME)nat.$(A) $(LIBNAME).$(A)
|
|
|
|
|
|
|
|
$(LIBNAME).cmxs: $(LIBNAME).cmxa lib$(LIBNAME)nat.$(A)
|
|
|
|
$(CAMLOPT) -shared -o $(LIBNAME).cmxs -I . $(LIBNAME).cmxa -linkall
|
|
|
|
|
|
|
|
lib$(LIBNAME)nat.$(A): $(COBJS_NAT)
|
|
|
|
$(MKLIB) -o $(LIBNAME)nat $(COBJS_NAT) $(LDOPTS)
|
1996-09-09 05:25:20 -07:00
|
|
|
|
2010-04-27 00:55:08 -07:00
|
|
|
st_stubs_n.$(O): st_stubs.c st_win32.h
|
2013-09-04 08:12:37 -07:00
|
|
|
$(NATIVECC) -DNATIVE_CODE -I../../asmrun -I../../byterun \
|
|
|
|
$(NATIVECCCOMPOPTS) -c st_stubs.c
|
2010-04-27 00:55:08 -07:00
|
|
|
mv st_stubs.$(O) st_stubs_n.$(O)
|
1996-09-09 05:25:20 -07:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
$(CAMLOBJS:.cmo=.cmx): ../../ocamlopt
|
1997-12-19 08:04:40 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean:
|
|
|
|
rm -f *.cm*
|
|
|
|
|
1997-03-05 02:48:39 -08:00
|
|
|
clean: partialclean
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f *.dll *.$(A) *.$(O)
|
1996-09-04 07:17:43 -07:00
|
|
|
|
2014-04-07 00:06:17 -07:00
|
|
|
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
|
|
|
|
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
|
|
|
|
|
1996-09-04 07:17:43 -07:00
|
|
|
install:
|
2014-04-07 00:06:17 -07:00
|
|
|
cp dllthreads.dll $(INSTALL_STUBLIBDIR)/dllthreads.dll
|
|
|
|
cp libthreads.$(A) $(INSTALL_LIBDIR)/libthreads.$(A)
|
|
|
|
mkdir -p $(INSTALL_LIBDIR)/threads
|
|
|
|
cp $(CMIFILES) threads.cma $(INSTALL_LIBDIR)/threads
|
|
|
|
rm -f $(INSTALL_LIBDIR)/threads/stdlib.cma
|
|
|
|
cp threads.h $(INSTALL_LIBDIR)/caml/threads.h
|
1996-09-04 07:17:43 -07:00
|
|
|
|
|
|
|
installopt:
|
2014-04-07 00:06:17 -07:00
|
|
|
cp libthreadsnat.$(A) $(INSTALL_LIBDIR)/libthreadsnat.$(A)
|
|
|
|
cp $(THREAD_OBJS:.cmo=.cmx) threads.cmxa threads.$(A) $(INSTALL_LIBDIR)/threads
|
|
|
|
cp threads.cmxs $(INSTALL_LIBDIR)/threads
|
1996-09-04 07:17:43 -07:00
|
|
|
|
1997-11-17 05:04:18 -08:00
|
|
|
.SUFFIXES: .ml .mli .cmo .cmi .cmx
|
1996-09-04 07:17:43 -07:00
|
|
|
|
|
|
|
.mli.cmi:
|
|
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
|
|
|
|
.ml.cmo:
|
2001-06-15 07:23:20 -07:00
|
|
|
$(CAMLC) -c -g $(COMPFLAGS) $<
|
1996-09-04 07:17:43 -07:00
|
|
|
|
|
|
|
.ml.cmx:
|
|
|
|
$(CAMLOPT) -c $(COMPFLAGS) $<
|
|
|
|
|
|
|
|
depend:
|
|
|
|
|
|
|
|
include .depend
|