102 lines
2.9 KiB
Makefile
102 lines
2.9 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$
|
|
|
|
# Makefile for the "num" (exact rational arithmetic) library
|
|
|
|
include ../../config/Makefile
|
|
|
|
# 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
|
|
|
|
DCOBJS=nat_stubs.$(DO)
|
|
SCOBJS=nat_stubs.$(SO)
|
|
BIGNUM_SOBJS=bignum/o/KerN.$(SO) bignum/o/bnInit.$(SO) \
|
|
bignum/o/bnMult.$(SO) bignum/o/bnDivide.$(SO) \
|
|
bignum/o/bnCmp.$(SO) bignum/o/bzf.$(SO) bignum/o/bz.$(SO)
|
|
|
|
all: dllnums.dll libnums.$(A) nums.cma $(CMIFILES)
|
|
|
|
allopt: libnums.$(A) nums.cmxa $(CMIFILES)
|
|
|
|
nums.cma: $(CAMLOBJS)
|
|
$(CAMLC) -a -o nums.cma $(CAMLOBJS) -dllib -lnums -cclib -lnums
|
|
|
|
nums.cmxa: $(CAMLOBJS:.cmo=.cmx)
|
|
$(CAMLOPT) -a -o nums.cmxa $(CAMLOBJS:.cmo=.cmx) -cclib -lnums
|
|
|
|
dllnums.dll: bignum/dbignum.$(A) $(DCOBJS)
|
|
$(call MKDLL,dllnums.dll,tmp.$(A),\
|
|
$(DCOBJS) bignum/dbignum.$(A) ../../byterun/ocamlrun.$(A))
|
|
rm tmp.*
|
|
|
|
libnums.$(A): bignum/sbignum.$(A) $(SCOBJS)
|
|
$(call MKLIB,libnums.$(A),$(SCOBJS) $(BIGNUM_SOBJS))
|
|
|
|
bignum/dbignum.$(A) bignum/sbignum.$(A):
|
|
cd bignum ; $(MAKEREC)
|
|
|
|
$(CAMLOBJS:.cmo=.cmx): ../../ocamlopt
|
|
|
|
install:
|
|
cp dllnums.dll $(STUBLIBDIR)/dllnums.dll
|
|
cp libnums.$(A) $(LIBDIR)/libnums.$(A)
|
|
cp nums.cma $(CMIFILES) $(LIBDIR)
|
|
|
|
installopt:
|
|
cp $(CAMLOBJS:.cmo=.cmx) nums.cmxa nums.$(A) $(LIBDIR)
|
|
|
|
partialclean:
|
|
rm -f *.cm*
|
|
|
|
clean: partialclean
|
|
rm -f *.dll *.$(A) *.$(O)
|
|
cd bignum ; $(MAKEREC) scratch
|
|
cd test ; $(MAKEREC) clean
|
|
|
|
.SUFFIXES: .ml .mli .cmi .cmo .cmx .$(DO) .$(SO)
|
|
|
|
.mli.cmi:
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
.ml.cmo:
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
.ml.cmx:
|
|
$(CAMLOPT) -c $(COMPFLAGS) $<
|
|
|
|
.c.$(DO):
|
|
$(BYTECC) $(DLLCCCOMPOPTS) $(CFLAGS) -c $<
|
|
mv $*.$(O) $*.$(DO)
|
|
|
|
.c.$(SO):
|
|
$(BYTECC) $(BYTECCCOMPOPTS) $(CFLAGS) -c $<
|
|
mv $*.$(O) $*.$(SO)
|
|
|
|
nat_stubs.$(O): nat.h
|
|
|
|
depend:
|
|
sed -e 's/\.o/.$(DO)/g' .depend > .depend.nt
|
|
sed -e 's/\.o/.$(SO)/g' .depend >> .depend.nt
|
|
|
|
include .depend.nt
|