ocaml/otherlibs/systhreads/Makefile.nt

105 lines
3.3 KiB
Makefile

#########################################################################
# #
# OCaml #
# #
# 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. #
# #
#########################################################################
include ../../config/Makefile
CAMLRUN ?= ../../boot/ocamlrun
CAMLYACC ?= ../../boot/ocamlyacc
# Compilation options
CAMLC=$(CAMLRUN) ../../ocamlc -I ../../stdlib -I ../win32unix
CAMLOPT=$(CAMLRUN) ../../ocamlopt -I ../../stdlib -I ../win32unix
COMPFLAGS=-w +33 -warn-error A -g
MKLIB=$(CAMLRUN) ../../tools/ocamlmklib
CFLAGS=-I../../byterun $(EXTRACFLAGS)
CAMLOBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
CMIFILES=$(CAMLOBJS:.cmo=.cmi)
COBJS=st_stubs_b.$(O)
COBJS_NAT=st_stubs_n.$(O)
LIBNAME=threads
all: lib$(LIBNAME).$(A) $(LIBNAME).cma $(CMIFILES)
allopt: lib$(LIBNAME).$(A) $(LIBNAME).cmxa $(LIBNAME).cmxs $(CMIFILES)
$(LIBNAME).cma: $(CAMLOBJS)
$(MKLIB) -o $(LIBNAME) -ocamlc "$(CAMLRUN) ../../ocamlc" \
-linkall $(CAMLOBJS) $(LINKOPTS)
lib$(LIBNAME).$(A): $(COBJS)
$(MKLIB) -o $(LIBNAME) $(COBJS) $(LDOPTS)
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)
$(LIBNAME).cmxa: $(CAMLOBJS:.cmo=.cmx)
$(MKLIB) -o $(LIBNAME)nat \
-ocamlopt "$(CAMLRUN) ../../ocamlopt" -linkall \
$(CAMLOBJS:.cmo=.cmx) $(LINKOPTS)
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)
st_stubs_n.$(O): st_stubs.c st_win32.h
$(NATIVECC) -DNATIVE_CODE -I../../asmrun -I../../byterun \
$(NATIVECCCOMPOPTS) -c st_stubs.c
mv st_stubs.$(O) st_stubs_n.$(O)
$(CAMLOBJS:.cmo=.cmx): ../../ocamlopt
partialclean:
rm -f *.cm*
clean: partialclean
rm -f *.dll *.$(A) *.$(O)
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
install:
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
installopt:
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
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.mli.cmi:
$(CAMLC) -c $(COMPFLAGS) $<
.ml.cmo:
$(CAMLC) -c -g $(COMPFLAGS) $<
.ml.cmx:
$(CAMLOPT) -c $(COMPFLAGS) $<
depend:
include .depend