97 lines
2.8 KiB
Makefile
97 lines
2.8 KiB
Makefile
#########################################################################
|
|
# #
|
|
# Objective Caml #
|
|
# #
|
|
# 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. #
|
|
# #
|
|
#########################################################################
|
|
|
|
# $Id$
|
|
|
|
include ../../config/Makefile
|
|
|
|
# Compilation options
|
|
CAMLC=../../boot/ocamlrun ../../ocamlc -I ../../stdlib -I ../win32unix
|
|
CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib -I ../win32unix
|
|
|
|
THREAD_OBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
|
|
|
|
GENFILES=thread.ml
|
|
|
|
all: dllthreads.dll libthreads.$(A) threads.cma
|
|
|
|
allopt: libthreadsnat.$(A) threads.cmxa
|
|
|
|
dllthreads.dll: win32_b.$(DO)
|
|
$(call MKDLL,dllthreads.dll,tmp.$(A),win32_b.$(DO) ../../byterun/ocamlrun.$(A))
|
|
rm tmp.*
|
|
|
|
libthreads.$(A): win32_b.$(SO)
|
|
$(call MKLIB,libthreads.$(A),win32_b.$(SO))
|
|
|
|
win32_b.$(DO): win32.c
|
|
$(BYTECC) -I../../byterun $(DLLCCCOMPOPTS) -c win32.c
|
|
mv win32.$(O) win32_b.$(DO)
|
|
|
|
win32_b.$(SO): win32.c
|
|
$(BYTECC) -I../../byterun $(BYTECCCOMPOPTS) -c win32.c
|
|
mv win32.$(O) win32_b.$(SO)
|
|
|
|
libthreadsnat.$(A): win32_n.$(O)
|
|
$(call MKLIB,libthreadsnat.$(A),win32_n.$(O))
|
|
|
|
win32_n.$(O): win32.c
|
|
$(NATIVECC) -DNATIVE_CODE -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) -c win32.c
|
|
mv win32.$(O) win32_n.$(O)
|
|
|
|
threads.cma: $(THREAD_OBJS)
|
|
$(CAMLC) -a -o threads.cma $(THREAD_OBJS) \
|
|
-dllib -lthreads -cclib -lthreads
|
|
|
|
threads.cmxa: $(THREAD_OBJS:.cmo=.cmx)
|
|
$(CAMLOPT) -a -o threads.cmxa $(THREAD_OBJS:.cmo=.cmx) \
|
|
-cclib -lthreadsnat
|
|
|
|
$(THREAD_OBJS:.cmo=.cmx): ../../ocamlopt
|
|
|
|
thread.ml: thread_win32.ml
|
|
cp thread_win32.ml thread.ml
|
|
|
|
partialclean:
|
|
rm -f *.cm*
|
|
|
|
clean: partialclean
|
|
rm -f *.dll *.$(A) *.$(O)
|
|
rm -f $(GENFILES)
|
|
|
|
install:
|
|
cp dllthreads.dll $(STUBLIBDIR)/dllthreads.dll
|
|
cp libthreads.$(A) $(LIBDIR)/libthreads.$(A)
|
|
mkdir -p $(LIBDIR)/threads
|
|
cp $(THREAD_OBJS:.cmo=.cmi) threads.cma $(LIBDIR)/threads
|
|
rm -f $(LIBDIR)/threads/stdlib.cma
|
|
|
|
installopt:
|
|
cp libthreadsnat.$(A) $(LIBDIR)/libthreadsnat.$(A)
|
|
cp $(THREAD_OBJS:.cmo=.cmx) threads.cmxa threads.$(A) $(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
|