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 #
|
|
|
|
# under the terms of the GNU Library General Public License. #
|
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
# $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)
|
|
|
|
CFLAGS=-O -I./bignum/h -I../../byterun $(BYTECCCOMPOPTS)
|
2000-02-05 04:16:09 -08:00
|
|
|
CAMLC=../../boot/ocamlrun ../../ocamlc -I ../../stdlib -w s
|
1998-11-12 08:53:20 -08:00
|
|
|
CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib -w s
|
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
|
|
|
|
|
|
|
|
all: libnums.a nums.cma $(CMIFILES)
|
|
|
|
|
|
|
|
allopt: libnums.a nums.cmxa $(CMIFILES)
|
|
|
|
|
|
|
|
nums.cma: $(CAMLOBJS)
|
2000-03-09 01:12:28 -08:00
|
|
|
$(CAMLC) -a -o nums.cma -custom $(CAMLOBJS) -cclib -lnums
|
1995-11-06 02:34:19 -08:00
|
|
|
|
|
|
|
nums.cmxa: $(CAMLOBJS:.cmo=.cmx)
|
2000-03-09 01:12:28 -08:00
|
|
|
$(CAMLOPT) -a -o nums.cmxa $(CAMLOBJS:.cmo=.cmx) -cclib -lnums
|
1995-11-26 12:23:16 -08:00
|
|
|
|
1995-11-06 02:34:19 -08:00
|
|
|
libnums.a: bignum/libbignum.a $(COBJS)
|
|
|
|
cp bignum/libbignum.a libnums.a
|
|
|
|
ar r libnums.a $(COBJS)
|
|
|
|
$(RANLIB) libnums.a
|
|
|
|
|
|
|
|
bignum/libbignum.a:
|
1999-03-10 02:04:28 -08:00
|
|
|
cd bignum; $(MAKE) $(BIGNUM_ARCH) CC="$(CC) $(BYTECCCOMPOPTS)"
|
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:
|
|
|
|
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
|
1995-11-06 03:09:03 -08:00
|
|
|
rm -f *.a *.o
|
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
|