ocaml/otherlibs/num/Makefile.nt

97 lines
2.7 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. #
# #
#########################################################################
# $Id$
# Makefile for the "num" (exact rational arithmetic) library
!include ..\..\config\Makefile.nt
# Compilation options
CC=$(BYTECC)
CFLAGS=-O -I.\bignum\h -I..\..\byterun
CAMLC=..\..\boot\ocamlrun ..\..\ocamlc -I ..\..\boot -w s
CAMLOPT=..\..\boot\ocamlrun ..\..\ocamlopt -I ..\..\stdlib -w s
CAMLOBJS=int_misc.cmo string_misc.cmo nat.cmo big_int.cmo arith_flags.cmo \
ratio.cmo num.cmo arith_status.cmo
CMIFILES=big_int.cmi nat.cmi num.cmi ratio.cmi arith_status.cmi
COBJS=nat_stubs.obj
all: libnums.dll libnums.lib nums.cma $(CMIFILES)
allopt: libnums.lib nums.cmxa $(CMIFILES)
nums.cma: $(CAMLOBJS)
$(CAMLC) -a -o nums.cma $(CAMLOBJS) -cclib -lnums
nums.cmxa: $(CAMLOBJS:.cmo=.cmx)
$(CAMLOPT) -a -o nums.cmxa $(CAMLOBJS:.cmo=.cmx) -cclib -lnums
libnums.dll: bignum\dbignum.lib $(COBJS:.obj=.dobj)
link /nologo /dll /out:libnums.dll /implib:tmp.lib \
bignum\dbignum.lib $(COBJS:.obj=.dobj) ..\..\byterun\ocamlrun.lib
rm tmp.*
libnums.lib: bignum\sbignum.lib $(COBJS:.obj=.sobj)
$(MKLIB)libnums.lib bignum\sbignum.lib $(COBJS:.obj=.sobj)
bignum\dbignum.lib bignum\sbignum.lib:
cd bignum & $(MAKEREC)
$(CAMLOBJS:.cmo=.cmx): ..\..\ocamlopt
install:
cp libnums.dll $(LIBDIR)\libnums.dll
cp libnums.lib $(LIBDIR)\libnums.lib
cp nums.cma $(CMIFILES) $(LIBDIR)
installopt:
cp $(CAMLOBJS:.cmo=.cmx) nums.cmxa nums.lib $(LIBDIR)
partialclean:
rm -f *.cm*
clean: partialclean
rm -f *.dll *.lib *.dobj *.sobj
cd bignum & $(MAKEREC) scratch
cd test & $(MAKEREC) clean
.SUFFIXES: .ml .mli .cmi .cmo .cmx .dobj .sobj
.mli.cmi:
$(CAMLC) -c $(COMPFLAGS) $<
.ml.cmo:
$(CAMLC) -c $(COMPFLAGS) $<
.ml.cmx:
$(CAMLOPT) -c $(COMPFLAGS) $<
.c.dobj:
$(BYTECC) $(DLLCCCOMPOPTS) $(CFLAGS) -c $<
mv $*.obj $*.dobj
.c.sobj:
$(BYTECC) $(BYTECCCOMPOPTS) $(CFLAGS) -c $<
mv $*.obj $*.sobj
nat_stubs.obj: nat.h
depend:
sed -e "s/\.o/.dobj/g" .depend > .depend.nt
sed -e "s/\.o/.sobj/g" .depend >> .depend.nt
!include .depend.nt