1999-11-17 10:59:06 -08:00
|
|
|
#########################################################################
|
|
|
|
# #
|
|
|
|
# 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 #
|
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
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
1995-11-06 02:34:19 -08:00
|
|
|
# Makefile for the "num" (exact rational arithmetic) library
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
include ../../config/Makefile
|
1995-11-06 02:34:19 -08:00
|
|
|
|
|
|
|
# Compilation options
|
|
|
|
CC=$(BYTECC)
|
2001-08-28 07:47:48 -07:00
|
|
|
CFLAGS=-O -I./bignum/h -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS)
|
2002-04-27 07:45:33 -07:00
|
|
|
CAMLC=../../ocamlcomp.sh -w s
|
|
|
|
CAMLOPT=../../ocamlcompopt.sh -w s
|
2001-11-08 02:32:24 -08:00
|
|
|
MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib
|
2002-01-20 07:12:32 -08:00
|
|
|
COMPFLAGS=-warn-error A
|
1995-11-06 02:34:19 -08:00
|
|
|
|
|
|
|
CAMLOBJS=int_misc.cmo string_misc.cmo nat.cmo big_int.cmo arith_flags.cmo \
|
|
|
|
ratio.cmo num.cmo arith_status.cmo
|
|
|
|
|
1996-10-09 02:41:21 -07:00
|
|
|
CMIFILES=big_int.cmi nat.cmi num.cmi ratio.cmi arith_status.cmi
|
1995-11-06 02:34:19 -08:00
|
|
|
|
|
|
|
COBJS=nat_stubs.o
|
2001-08-28 07:47:48 -07:00
|
|
|
BIGNUM_OBJS=bignum/o/KerN.o bignum/o/bnInit.o bignum/o/bnMult.o \
|
|
|
|
bignum/o/bnDivide.o bignum/o/bnCmp.o bignum/o/bzf.o bignum/o/bz.o
|
1995-11-06 02:34:19 -08:00
|
|
|
|
|
|
|
all: libnums.a nums.cma $(CMIFILES)
|
|
|
|
|
|
|
|
allopt: libnums.a nums.cmxa $(CMIFILES)
|
|
|
|
|
|
|
|
nums.cma: $(CAMLOBJS)
|
2001-08-28 07:47:48 -07:00
|
|
|
$(MKLIB) -ocamlc '$(CAMLC)' -o nums $(CAMLOBJS)
|
1995-11-06 02:34:19 -08:00
|
|
|
|
|
|
|
nums.cmxa: $(CAMLOBJS:.cmo=.cmx)
|
2001-08-28 07:47:48 -07:00
|
|
|
$(MKLIB) -ocamlopt '$(CAMLOPT)' -o nums $(CAMLOBJS:.cmo=.cmx)
|
1995-11-26 12:23:16 -08:00
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
libnums.a: $(BIGNUM_OBJS) $(COBJS)
|
|
|
|
$(MKLIB) -o nums $(BIGNUM_OBJS) $(COBJS)
|
1995-11-06 02:34:19 -08:00
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
$(BIGNUM_OBJS):
|
|
|
|
cd bignum; $(MAKE) $(BIGNUM_ARCH) CC="$(CC) $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS)"
|
1995-11-06 02:34:19 -08:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
$(CAMLOBJS:.cmo=.cmx): ../../ocamlopt
|
1995-11-26 12:23:16 -08:00
|
|
|
|
1995-11-06 02:34:19 -08:00
|
|
|
install:
|
2002-06-27 04:36:02 -07:00
|
|
|
if test -f dllnums.so; then cp dllnums.so $(STUBLIBDIR)/dllnums.so; fi
|
1995-11-06 02:34:19 -08:00
|
|
|
cp libnums.a $(LIBDIR)/libnums.a
|
|
|
|
cd $(LIBDIR); $(RANLIB) libnums.a
|
1997-07-30 05:29:46 -07:00
|
|
|
cp nums.cma $(CMIFILES) $(CMIFILES:.cmi=.mli) $(LIBDIR)
|
1995-11-06 02:34:19 -08:00
|
|
|
|
|
|
|
installopt:
|
1995-11-09 05:23:22 -08:00
|
|
|
cp $(CAMLOBJS:.cmo=.cmx) nums.cmxa nums.a $(LIBDIR)
|
1995-11-06 02:34:19 -08:00
|
|
|
cd $(LIBDIR); $(RANLIB) nums.a
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean:
|
1995-11-06 03:09:03 -08:00
|
|
|
rm -f *.cm*
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
clean: partialclean
|
2001-08-28 07:47:48 -07:00
|
|
|
rm -f *.a *.o *.so
|
1995-12-05 05:09:02 -08:00
|
|
|
cd bignum; $(MAKE) scratch
|
|
|
|
cd test; $(MAKE) clean
|
1995-11-06 02:34:19 -08:00
|
|
|
|
1996-10-07 07:03:20 -07:00
|
|
|
.SUFFIXES: .ml .mli .cmi .cmo .cmx
|
1995-11-06 02:34:19 -08:00
|
|
|
|
|
|
|
.mli.cmi:
|
|
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
|
|
|
|
.ml.cmo:
|
|
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
|
|
|
|
.ml.cmx:
|
|
|
|
$(CAMLOPT) -c $(COMPFLAGS) $<
|
|
|
|
|
|
|
|
nat_stubs.o: nat.h
|
|
|
|
|
1996-10-07 07:03:20 -07:00
|
|
|
depend:
|
1995-11-06 02:34:19 -08:00
|
|
|
gcc -MM $(CFLAGS) *.c > .depend
|
1998-04-21 09:09:03 -07:00
|
|
|
../../boot/ocamlrun ../../tools/ocamldep *.mli *.ml >> .depend
|
1995-11-06 02:34:19 -08:00
|
|
|
|
|
|
|
include .depend
|