home *** CD-ROM | disk | FTP | other *** search
Makefile | 1995-02-23 | 12.7 KB | 280 lines |
- # Makefile for GNU MP (a.k.a. biGNUm)
- # Copyright (C) 1991, 1993 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2, or (at your option)
- # any later version.
-
- # The GNU MP Library is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
-
- # You should have received a copy of the GNU General Public License
- # along with the GNU MP Library; see the file COPYING. If not, write to
- # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
- CC = gcc -mstubs
-
- # If you cross compile on a machine with the same sizes of the integral
- # types ("int", "long int", "short int", and "char") define this as the
- # local compiler. Otherwise, you need look for the uses of LOCAL_CC below,
- # and handle those cases manually.
- LOCAL_CC = $(CC)
- OPT = -O2
- CFLAGS = -I. $(OPT) -DARCH
- AR = makeALF
- RANLIB= echo
-
- # Hideous macro to convert RISC OS dependencies to gcc Unix filenames.
- define UBASE
- $(subst .,/,$(dir $@))$(basename $@)
- endef
-
- o.%: c.%
- $(CC) $(CFLAGS) -c $(expand $(UBASE)).c -o $(expand $(UBASE)).o
-
- IMPL_SRCS = c.memory c.mp_set_fns mpz.c._set_str mpz.c._get_str \
- mpz.c.realloc c.mp_clz_tab c.alloca
- IMPL_OBJS = o.memory o.mp_set_fns mpz.o._set_str mpz.o._get_str \
- mpz.o.realloc o.mp_clz_tab o.alloca
-
- MPZ_SRCS = mpz.c.init mpz.c.set mpz.c.set_ui mpz.c.set_si mpz.c.set_str \
- mpz.c.iset mpz.c.iset_ui mpz.c.iset_si mpz.c.iset_str mpz.c.clear \
- mpz.c.get_ui mpz.c.get_si mpz.c.get_str mpz.c.size mpz.c.sizeinb \
- mpz.c.add mpz.c.add_ui mpz.c.sub mpz.c.sub_ui mpz.c.mul mpz.c.mul_ui \
- mpz.c.div mpz.c.div_ui mpz.c.mod mpz.c.mod_ui mpz.c.dm mpz.c.dm_ui \
- mpz.c.mdiv mpz.c.mmod mpz.c.mdm mpz.c.mdiv_ui mpz.c.mmod_ui mpz.c.mdm_ui \
- mpz.c.gcd mpz.c.gcdext mpz.c.sqrt mpz.c.sqrtrem mpz.c.powm mpz.c.powm_ui \
- mpz.c.cmp mpz.c.cmp_ui mpz.c.cmp_si mpz.c.mul_2exp mpz.c.div_2exp \
- mpz.c.mod_2exp mpz.c.abs mpz.c.neg mpz.c.com mpz.c.and mpz.c.ior \
- mpz.c.inp_raw mpz.c.inp_str mpz.c.out_raw mpz.c.out_str \
- mpz.c.perfsqr mpz.c.random mpz.c.random2 mpz.c.pow_ui \
- mpz.c.clrbit mpz.c.fac_ui mpz.c.pprime_p
- MPZ_OBJS = mpz.o.init mpz.o.set mpz.o.set_ui mpz.o.set_si mpz.o.set_str \
- mpz.o.iset mpz.o.iset_ui mpz.o.iset_si mpz.o.iset_str mpz.o.clear \
- mpz.o.get_ui mpz.o.get_si mpz.o.get_str mpz.o.size mpz.o.sizeinb \
- mpz.o.add mpz.o.add_ui mpz.o.sub mpz.o.sub_ui mpz.o.mul mpz.o.mul_ui \
- mpz.o.div mpz.o.div_ui mpz.o.mod mpz.o.mod_ui mpz.o.dm mpz.o.dm_ui \
- mpz.o.mdiv mpz.o.mmod mpz.o.mdm mpz.o.mdiv_ui mpz.o.mmod_ui mpz.o.mdm_ui \
- mpz.o.gcd mpz.o.gcdext mpz.o.sqrt mpz.o.sqrtrem mpz.o.powm mpz.o.powm_ui \
- mpz.o.cmp mpz.o.cmp_ui mpz.o.cmp_si mpz.o.mul_2exp mpz.o.div_2exp \
- mpz.o.mod_2exp mpz.o.abs mpz.o.neg mpz.o.com mpz.o.and mpz.o.ior \
- mpz.o.inp_raw mpz.o.inp_str mpz.o.out_raw mpz.o.out_str \
- mpz.o.perfsqr mpz.o.random mpz.o.random2 mpz.o.pow_ui \
- mpz.o.clrbit mpz.o.fac_ui mpz.o.pprime_p
-
- MPQ_SRCS = mpq.c.init mpq.c.set mpq.c.set_ui mpq.c.set_si \
- mpq.c.set_num mpq.c.set_den mpq.c.get_num mpq.c.get_den \
- mpq.c.add mpq.c.sub mpq.c.mul mpq.c.div \
- mpq.c.clear mpq.c.cmp mpq.c.inv mpq.c.neg
- MPQ_OBJS = mpq.o.init mpq.o.set mpq.o.set_ui mpq.o.set_si \
- mpq.o.set_num mpq.o.set_den mpq.o.get_num mpq.o.get_den \
- mpq.o.add mpq.o.sub mpq.o.mul mpq.o.div \
- mpq.o.clear mpq.o.cmp mpq.o.inv mpq.o.neg
-
- MPN_SRCS = mpn.c.add mpn.c.sub mpn.c.cmp mpn.c.mul mpn.c.div mpn.c.dm_1 \
- mpn.c.mod_1 mpn.c.lshift mpn.c.rshift mpn.c.rshiftci mpn.c.sqrt
- MPN_OBJS = mpn.o.add mpn.o.sub mpn.o.cmp mpn.o.mul mpn.o.div mpn.o.dm_1 \
- mpn.o.mod_1 mpn.o.lshift mpn.o.rshift mpn.o.rshiftci mpn.o.sqrt
-
- # There are fewer members in the BSDMP_SRCS list that in the BSDMP_OBJS
- # list because some of the c. files are created by this Makefile.
- BSDMP_SRCS = c.itom c.mdiv c.move c.mtox c.xtom c.sdiv c.mout c.min c.mfree
- BSDMP_OBJS = o.gcd o.itom o.madd o.mcmp o.mdiv o.move o.msub o.mtox o.mult \
- o.pow o.rpow o.xtom o.msqrt o.sdiv o.mout o.min o.mfree
-
- SRCS = $(MPZ_SRCS) $(MPQ_SRCS) $(BSDMP_SRCS) $(MPN_SRCS) $(IMPL_SRCS)
- OBJS = $(MPZ_OBJS) $(MPQ_OBJS) $(BSDMP_OBJS) $(MPN_OBJS) $(IMPL_OBJS)
-
- MP_OBJS = $(BSDMP_OBJS) $(MPN_OBJS) $(IMPL_OBJS) o.mp_bases mpz.o.sizeinb
- GMP_OBJS = $(MPZ_OBJS) $(MPQ_OBJS) $(MPN_OBJS) $(IMPL_OBJS) o.mp_bases
-
- all: libgmp libmp
-
- define EQUAL
- =
- endef
-
- check: libgmp
- $(MAKE) -C tests CC$(EQUAL)"$(CC)" OPT$(EQUAL)"$(OPT)"
-
- libgmp: $(GMP_OBJS)
- rm -f $@ listfile
- touch listfile
- $(dolines i,$^, echo $i { >> listfile })
- -makealf -i listfile -o $@
- rm listfile
-
- # libmp.a depend on libgmp.a, to get around Unix(tm) ar/ranlib concurrency bug.
- libmp: $(MP_OBJS)
- rm -f $@ listfile
- touch listfile
- $(dolines i,$^, echo $i { >> listfile })
- -makealf -i listfile -o $@
- rm listfile
-
- c.mp_bases: creconvtab
- creconvtab > c.mp_bases
-
- creconvtab: o.creconvtab o.alloca o.memory h.gmp h.gmp-impl h.gmp-mparam h.longlong
- $(CC) $(CFLAGS) -o creconvtab o.creconvtab o.alloca o.memory
-
- h.gmp-mparam: cre-mparam
- cre-mparam > h.gmp-mparam
-
- cre-mparam: c.cre-mparam h.gmp
- $(LOCAL_CC) $(CFLAGS) c.cre-mparam -o $@
-
- c.gcd : mpz.c.gcd h.mp h.gmp h.gmp-impl h.gmp-mparam h.longlong
- $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz/c.gcd > tmpfile
- egrep -h -v '^\#' tmpfile > $@
- rm tmpfile
-
- c.pow : mpz.c.powm h.mp h.gmp h.gmp-impl h.gmp-mparam h.longlong
- $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz/powm.c > tmpfile
- egrep -h -v '^\#' tmpfile > $@
- rm tmpfile
-
- c.rpow: mpz.c.pow_ui h.mp h.gmp h.gmp-impl h.gmp-mparam h.longlong
- $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz/pow_ui.c > tmpfile
- egrep -h -v '^\#' tmpfile > $@
- rm tmpfile
-
- c.madd : mpz.c.add h.mp h.gmp h.gmp-impl h.gmp-mparam
- $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz/add.c > tmpfile
- egrep -h -v '^\#' tmpfile > $@
- rm tmpfile
-
- c.msub : mpz.c.sub h.mp h.gmp h.gmp-impl h.gmp-mparam
- $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz/sub.c > tmpfile
- egrep -h -v '^\#' tmpfile > $@
- rm tmpfile
-
- c.mult : mpz.c.mul h.mp h.gmp h.gmp-impl h.gmp-mparam
- $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz/mul.c > tmpfile
- egrep -h -v '^\#' tmpfile > $@
- rm tmpfile
-
- c.mcmp : mpz.c.cmp h.mp h.gmp h.gmp-impl h.gmp-mparam
- $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz/cmp.c > tmpfile
- egrep -h -v '^\#' tmpfile > $@
- rm tmpfile
-
- c.msqrt : mpz.c.sqrtrem h.mp h.gmp h.gmp-impl h.gmp-mparam
- $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz/sqrtrem.c > tmpfile
- egrep -h -v '^\#' tmpfile > $@
- rm tmpfile
-
- # Automatically generated dependencies
- mpz.o._get_str : mpz.c._get_str h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o._set_str : mpz.c._set_str h.gmp h.gmp-impl h.gmp-mparam h.longlong
- o.cre-conv-tab : c.cre-conv-tab h.gmp h.gmp-impl h.gmp-mparam h.longlong
- o.cre-mparam : c.cre-mparam h.gmp
- o.cre-stddefh : c.cre-stddefh
- o.itom : c.itom h.mp h.gmp h.gmp-impl h.gmp-mparam
- o.mdiv : c.mdiv h.mp h.gmp h.gmp-impl h.gmp-mparam h.longlong mpz.c.dmincl
- o.memory : c.memory h.gmp h.gmp-impl h.gmp-mparam
- o.mfree : c.mfree h.mp h.gmp h.gmp-impl h.gmp-mparam
- o.min : c.min h.mp h.gmp h.gmp-impl h.gmp-mparam
- o.mout : c.mout h.mp h.gmp h.gmp-impl h.gmp-mparam
- o.move : c.move h.mp h.gmp h.gmp-impl h.gmp-mparam
- o.mp_bases : c.mp_bases h.gmp h.gmp-impl h.gmp-mparam
- o.mp_clz_tab : c.mp_clz_tab h.gmp h.gmp-impl h.gmp-mparam
- o.mp_set_fns : c.mp_set_fns h.gmp h.gmp-impl h.gmp-mparam
- mpn.o.add : mpn.c.add h.gmp h.gmp-impl h.gmp-mparam
- mpn.o.cmp : mpn.c.cmp h.gmp h.gmp-impl h.gmp-mparam
- mpn.o.div : mpn.c.div h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpn.o.dm_1 : mpn.c.dm_1 h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpn.o.lshift : mpn.c.lshift h.gmp h.gmp-impl h.gmp-mparam
- mpn.o.mod_1 : mpn.c.mod_1 h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpn.o.mul : mpn.c.mul h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpn.o.rshift : mpn.c.rshift h.gmp h.gmp-impl h.gmp-mparam
- mpn.o.rshiftci : mpn.c.rshiftci h.gmp h.gmp-impl h.gmp-mparam
- mpn.o.sqrt : mpn.c.sqrt h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpn.o.sub : mpn.c.sub h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.add : mpq.c.add h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.clear : mpq.c.clear h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.cmp : mpq.c.cmp h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.div : mpq.c.div h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.get_den : mpq.c.get_den h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.get_num : mpq.c.get_num h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.init : mpq.c.init h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.inv : mpq.c.inv h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.mul : mpq.c.mul h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.neg : mpq.c.neg h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.set : mpq.c.set h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.set_den : mpq.c.set_den h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.set_num : mpq.c.set_num h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.set_si : mpq.c.set_si h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.set_ui : mpq.c.set_ui h.gmp h.gmp-impl h.gmp-mparam
- mpq.o.sub : mpq.c.sub h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.abs : mpz.c.abs h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.add : mpz.c.add h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.add_ui : mpz.c.add_ui h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.and : mpz.c.and h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.clear : mpz.c.clear h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.clrbit : mpz.c.clrbit h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.cmp : mpz.c.cmp h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.cmp_si : mpz.c.cmp_si h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.cmp_ui : mpz.c.cmp_ui h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.com : mpz.c.com h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.div : mpz.c.div h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.div_2exp : mpz.c.div_2exp h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.div_ui : mpz.c.div_ui h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.dm : mpz.c.dm h.gmp h.gmp-impl h.gmp-mparam h.longlong mpz.c.dmincl
- mpz.o.dm_ui : mpz.c.dm_ui h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.fac_ui : mpz.c.fac_ui h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.gcd : mpz.c.gcd h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.gcdext : mpz.c.gcdext h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.get_si : mpz.c.get_si h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.get_str : mpz.c.get_str h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.get_ui : mpz.c.get_ui h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.init : mpz.c.init h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.inp_raw : mpz.c.inp_raw h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.inp_str : mpz.c.inp_str h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.ior : mpz.c.ior h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.iset : mpz.c.iset h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.iset_si : mpz.c.iset_si h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.iset_str : mpz.c.iset_str h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.iset_ui : mpz.c.iset_ui h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.mdiv : mpz.c.mdiv h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.mdiv_ui : mpz.c.mdiv_ui h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.mdm : mpz.c.mdm h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.mdm_ui : mpz.c.mdm_ui h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.mmod : mpz.c.mmod h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.mmod_ui : mpz.c.mmod_ui h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.mod : mpz.c.mod h.gmp h.gmp-impl h.gmp-mparam h.longlong mpz.c.dmincl
- mpz.o.mod_2exp : mpz.c.mod_2exp h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.mod_ui : mpz.c.mod_ui h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.mul : mpz.c.mul h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.mul_2exp : mpz.c.mul_2exp h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.mul_ui : mpz.c.mul_ui h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.neg : mpz.c.neg h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.out_raw : mpz.c.out_raw h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.out_str : mpz.c.out_str h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.perfsqr : mpz.c.perfsqr h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.pow_ui : mpz.c.pow_ui h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.powm : mpz.c.powm h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.powm_ui : mpz.c.powm_ui h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.pprime_p : mpz.c.pprime_p h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.random : mpz.c.random h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.random2 : mpz.c.random2 h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.realloc : mpz.c.realloc h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.set : mpz.c.set h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.set_si : mpz.c.set_si h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.set_str : mpz.c.set_str h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.set_ui : mpz.c.set_ui h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.size : mpz.c.size h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.sizeinb : mpz.c.sizeinb h.gmp h.gmp-impl h.gmp-mparam h.longlong
- mpz.o.sqrt : mpz.c.sqrt h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.sqrtrem : mpz.c.sqrtrem h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.sub : mpz.c.sub h.gmp h.gmp-impl h.gmp-mparam
- mpz.o.sub_ui : mpz.c.sub_ui h.gmp h.gmp-impl h.gmp-mparam
- o.mtox : c.mtox h.mp h.gmp h.gmp-impl h.gmp-mparam
- o.sdiv : c.sdiv h.mp h.gmp h.gmp-impl h.gmp-mparam h.longlong
- o.xtom : c.xtom h.mp h.gmp h.gmp-impl h.gmp-mparam
-