BMake the multiprecision library, and fix as many of the -Wall warnings

as is now feasable.
This commit is contained in:
Mark Murray 1995-11-12 14:55:48 +00:00
parent ae82e96f8c
commit 43f0bbcd01
4 changed files with 380 additions and 282 deletions

289
gnu/lib/libgmp/Makefile.GNU Normal file
View File

@ -0,0 +1,289 @@
# 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
# 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 = -O -g
CFLAGS = -I. $(OPT)
AR = ar
RANLIB=`if [ -r /bin/ranlib -o -r /usr/bin/ranlib ]; \
then echo ranlib; else echo true; fi`
SHELL = /bin/sh
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) mp_bases.o mpz_sizeinb.o
GMP_OBJS = $(MPZ_OBJS) $(MPQ_OBJS) $(MPN_OBJS) $(IMPL_OBJS) mp_bases.o
IMPL_SRCS = memory.c mp_set_fns.c _mpz_set_str.c _mpz_get_str.c \
mpz_realloc.c mp_clz_tab.c alloca.c
IMPL_OBJS = memory.o mp_set_fns.o _mpz_set_str.o _mpz_get_str.o \
mpz_realloc.o mp_clz_tab.o alloca.o
MPZ_SRCS = mpz_init.c mpz_set.c mpz_set_ui.c mpz_set_si.c mpz_set_str.c \
mpz_iset.c mpz_iset_ui.c mpz_iset_si.c mpz_iset_str.c mpz_clear.c \
mpz_get_ui.c mpz_get_si.c mpz_get_str.c mpz_size.c mpz_sizeinb.c \
mpz_add.c mpz_add_ui.c mpz_sub.c mpz_sub_ui.c mpz_mul.c mpz_mul_ui.c \
mpz_div.c mpz_div_ui.c mpz_mod.c mpz_mod_ui.c mpz_dm.c mpz_dm_ui.c \
mpz_mdiv.c mpz_mmod.c mpz_mdm.c mpz_mdiv_ui.c mpz_mmod_ui.c mpz_mdm_ui.c \
mpz_gcd.c mpz_gcdext.c mpz_sqrt.c mpz_sqrtrem.c mpz_powm.c mpz_powm_ui.c \
mpz_cmp.c mpz_cmp_ui.c mpz_cmp_si.c mpz_mul_2exp.c mpz_div_2exp.c \
mpz_mod_2exp.c mpz_abs.c mpz_neg.c mpz_com.c mpz_and.c mpz_ior.c \
mpz_inp_raw.c mpz_inp_str.c mpz_out_raw.c mpz_out_str.c \
mpz_perfsqr.c mpz_random.c mpz_random2.c mpz_pow_ui.c \
mpz_clrbit.c mpz_fac_ui.c mpz_pprime_p.c
MPZ_OBJS = mpz_init.o mpz_set.o mpz_set_ui.o mpz_set_si.o mpz_set_str.o \
mpz_iset.o mpz_iset_ui.o mpz_iset_si.o mpz_iset_str.o mpz_clear.o \
mpz_get_ui.o mpz_get_si.o mpz_get_str.o mpz_size.o mpz_sizeinb.o \
mpz_add.o mpz_add_ui.o mpz_sub.o mpz_sub_ui.o mpz_mul.o mpz_mul_ui.o \
mpz_div.o mpz_div_ui.o mpz_mod.o mpz_mod_ui.o mpz_dm.o mpz_dm_ui.o \
mpz_mdiv.o mpz_mmod.o mpz_mdm.o mpz_mdiv_ui.o mpz_mmod_ui.o mpz_mdm_ui.o \
mpz_gcd.o mpz_gcdext.o mpz_sqrt.o mpz_sqrtrem.o mpz_powm.o mpz_powm_ui.o \
mpz_cmp.o mpz_cmp_ui.o mpz_cmp_si.o mpz_mul_2exp.o mpz_div_2exp.o \
mpz_mod_2exp.o mpz_abs.o mpz_neg.o mpz_com.o mpz_and.o mpz_ior.o \
mpz_inp_raw.o mpz_inp_str.o mpz_out_raw.o mpz_out_str.o \
mpz_perfsqr.o mpz_random.o mpz_random2.o mpz_pow_ui.o \
mpz_clrbit.o mpz_fac_ui.o mpz_pprime_p.o
MPQ_SRCS = mpq_init.c mpq_set.c mpq_set_ui.c mpq_set_si.c \
mpq_set_num.c mpq_set_den.c mpq_get_num.c mpq_get_den.c \
mpq_add.c mpq_sub.c mpq_mul.c mpq_div.c \
mpq_clear.c mpq_cmp.c mpq_inv.c mpq_neg.c
MPQ_OBJS = mpq_init.o mpq_set.o mpq_set_ui.o mpq_set_si.o \
mpq_set_num.o mpq_set_den.o mpq_get_num.o mpq_get_den.o \
mpq_add.o mpq_sub.o mpq_mul.o mpq_div.o \
mpq_clear.o mpq_cmp.o mpq_inv.o mpq_neg.o
MPN_SRCS = mpn_add.c mpn_sub.c mpn_cmp.c mpn_mul.c mpn_div.c mpn_dm_1.c \
mpn_mod_1.c mpn_lshift.c mpn_rshift.c mpn_rshiftci.c mpn_sqrt.c
MPN_OBJS = mpn_add.o mpn_sub.o mpn_cmp.o mpn_mul.o mpn_div.o mpn_dm_1.o \
mpn_mod_1.o mpn_lshift.o mpn_rshift.o mpn_rshiftci.o mpn_sqrt.o
# 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 = itom.c mdiv.c move.c mtox.c xtom.c sdiv.c mout.c min.c mfree.c
BSDMP_OBJS = 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.o
all: libgmp.a libmp.a
check: libgmp.a
cd tests; $(MAKE) CC="$(CC)" SHELL="$(SHELL)" OPT="$(OPT)"
libgmp.a: stamp-stddefh $(GMP_OBJS)
rm -f $@
$(AR) cr $@ $(GMP_OBJS)
$(RANLIB) $@
# libmp.a depend on libgmp.a, to get around Unix(tm) ar/ranlib concurrency bug.
libmp.a: stamp-stddefh $(MP_OBJS) libgmp.a
rm -f $@
$(AR) cr $@ $(MP_OBJS)
$(RANLIB) $@
stamp-stddefh:
rm -f stddef.h
rm -f test-stddefh.c
( echo '#include <stddef.h>' ;\
echo 'main(){size_t foo=sizeof(size_t);exit(0);}' ;\
) > test-stddefh.c
@if $(LOCAL_CC) $(CFLAGS) test-stddefh.c -c 2> /dev/null ;\
then true ;\
else \
echo 'This machine has no "stddef.h". Creating a minimal in ./';\
$(LOCAL_CC) $(CFLAGS) cre-stddefh.c -o cre-stddefh ;\
./cre-stddefh > stddef.h ;\
fi
rm -f test-stddefh.o
touch stamp-stddefh
mp_bases.c: cre-conv-tab
./cre-conv-tab > tmp-$@
mv tmp-$@ $@
cre-conv-tab: cre-conv-tab.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(LOCAL_CC) $(CFLAGS) `if [ x$(firstword $^) = x ]; \
then echo cre-conv-tab.c; \
else echo $(firstword $^); fi` -o $@ -lm
gmp-mparam.h: cre-mparam
./cre-mparam > tmp-$@
mv tmp-$@ $@
cre-mparam: cre-mparam.c stamp-stddefh gmp.h
$(LOCAL_CC) $(CFLAGS) cre-mparam.c -o $@
gcd.c : mpz_gcd.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_gcd.c \
| grep -v '^#' > $@
pow.c : mpz_powm.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_powm.c\
| grep -v '^#' > $@
rpow.c: mpz_pow_ui.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_pow_ui.c\
| grep -v '^#' > $@
madd.c : mpz_add.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_add.c\
| grep -v '^#' > $@
msub.c : mpz_sub.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_sub.c\
| grep -v '^#' > $@
mult.c : mpz_mul.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_mul.c\
| grep -v '^#' > $@
mcmp.c : mpz_cmp.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_cmp.c\
| grep -v '^#' > $@
msqrt.c : mpz_sqrtrem.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_sqrtrem.c\
| grep -v '^#' > $@
doc: gmp.dvi gmp.info
LN = ln -s
gmp.dvi: gmp.texi
rm -f tmp.texi
$(LN) gmp.texi tmp.texi
tex tmp.texi < /dev/null
texindex tmp.cp tmp.fn
tex tmp.texi < /dev/null 2> /dev/null
mv tmp.dvi gmp.dvi
gmp.info: gmp.texi
makeinfo gmp.texi
clean:
rm -f *.o libgmp.a libmp.a cre-conv-tab cre-mparam cre-stddefh \
gmp.dvi gmp.info mp_bases.c gmp-mparam.h stamp-stddefh test-stddefh.c \
stddef.h gcd.c pow.c rpow.c madd.c msub.c mult.c mcmp.c msqrt.c \
tmp.* tmp-* gmp.ps core
-cd tests; $(MAKE) clean
realclean: clean
# Automatically generated dependencies
_mpz_get_str.o : _mpz_get_str.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
_mpz_set_str.o : _mpz_set_str.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
cre-conv-tab.o : cre-conv-tab.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
cre-mparam.o : cre-mparam.c gmp.h
cre-stddefh.o : cre-stddefh.c
itom.o : itom.c mp.h gmp.h gmp-impl.h gmp-mparam.h
mdiv.o : mdiv.c mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h mpz_dmincl.c
memory.o : memory.c gmp.h gmp-impl.h gmp-mparam.h
mfree.o : mfree.c mp.h gmp.h gmp-impl.h gmp-mparam.h
min.o : min.c mp.h gmp.h gmp-impl.h gmp-mparam.h
mout.o : mout.c mp.h gmp.h gmp-impl.h gmp-mparam.h
move.o : move.c mp.h gmp.h gmp-impl.h gmp-mparam.h
mp_bases.o : mp_bases.c gmp.h gmp-impl.h gmp-mparam.h
mp_clz_tab.o : mp_clz_tab.c gmp.h gmp-impl.h gmp-mparam.h
mp_set_fns.o : mp_set_fns.c gmp.h gmp-impl.h gmp-mparam.h
mpn_add.o : mpn_add.c gmp.h gmp-impl.h gmp-mparam.h
mpn_cmp.o : mpn_cmp.c gmp.h gmp-impl.h gmp-mparam.h
mpn_div.o : mpn_div.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpn_dm_1.o : mpn_dm_1.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpn_lshift.o : mpn_lshift.c gmp.h gmp-impl.h gmp-mparam.h
mpn_mod_1.o : mpn_mod_1.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpn_mul.o : mpn_mul.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpn_rshift.o : mpn_rshift.c gmp.h gmp-impl.h gmp-mparam.h
mpn_rshiftci.o : mpn_rshiftci.c gmp.h gmp-impl.h gmp-mparam.h
mpn_sqrt.o : mpn_sqrt.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpn_sub.o : mpn_sub.c gmp.h gmp-impl.h gmp-mparam.h
mpq_add.o : mpq_add.c gmp.h gmp-impl.h gmp-mparam.h
mpq_clear.o : mpq_clear.c gmp.h gmp-impl.h gmp-mparam.h
mpq_cmp.o : mpq_cmp.c gmp.h gmp-impl.h gmp-mparam.h
mpq_div.o : mpq_div.c gmp.h gmp-impl.h gmp-mparam.h
mpq_get_den.o : mpq_get_den.c gmp.h gmp-impl.h gmp-mparam.h
mpq_get_num.o : mpq_get_num.c gmp.h gmp-impl.h gmp-mparam.h
mpq_init.o : mpq_init.c gmp.h gmp-impl.h gmp-mparam.h
mpq_inv.o : mpq_inv.c gmp.h gmp-impl.h gmp-mparam.h
mpq_mul.o : mpq_mul.c gmp.h gmp-impl.h gmp-mparam.h
mpq_neg.o : mpq_neg.c gmp.h gmp-impl.h gmp-mparam.h
mpq_set.o : mpq_set.c gmp.h gmp-impl.h gmp-mparam.h
mpq_set_den.o : mpq_set_den.c gmp.h gmp-impl.h gmp-mparam.h
mpq_set_num.o : mpq_set_num.c gmp.h gmp-impl.h gmp-mparam.h
mpq_set_si.o : mpq_set_si.c gmp.h gmp-impl.h gmp-mparam.h
mpq_set_ui.o : mpq_set_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpq_sub.o : mpq_sub.c gmp.h gmp-impl.h gmp-mparam.h
mpz_abs.o : mpz_abs.c gmp.h gmp-impl.h gmp-mparam.h
mpz_add.o : mpz_add.c gmp.h gmp-impl.h gmp-mparam.h
mpz_add_ui.o : mpz_add_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_and.o : mpz_and.c gmp.h gmp-impl.h gmp-mparam.h
mpz_clear.o : mpz_clear.c gmp.h gmp-impl.h gmp-mparam.h
mpz_clrbit.o : mpz_clrbit.c gmp.h gmp-impl.h gmp-mparam.h
mpz_cmp.o : mpz_cmp.c gmp.h gmp-impl.h gmp-mparam.h
mpz_cmp_si.o : mpz_cmp_si.c gmp.h gmp-impl.h gmp-mparam.h
mpz_cmp_ui.o : mpz_cmp_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_com.o : mpz_com.c gmp.h gmp-impl.h gmp-mparam.h
mpz_div.o : mpz_div.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_div_2exp.o : mpz_div_2exp.c gmp.h gmp-impl.h gmp-mparam.h
mpz_div_ui.o : mpz_div_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_dm.o : mpz_dm.c gmp.h gmp-impl.h gmp-mparam.h longlong.h mpz_dmincl.c
mpz_dm_ui.o : mpz_dm_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_fac_ui.o : mpz_fac_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_gcd.o : mpz_gcd.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_gcdext.o : mpz_gcdext.c gmp.h gmp-impl.h gmp-mparam.h
mpz_get_si.o : mpz_get_si.c gmp.h gmp-impl.h gmp-mparam.h
mpz_get_str.o : mpz_get_str.c gmp.h gmp-impl.h gmp-mparam.h
mpz_get_ui.o : mpz_get_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_init.o : mpz_init.c gmp.h gmp-impl.h gmp-mparam.h
mpz_inp_raw.o : mpz_inp_raw.c gmp.h gmp-impl.h gmp-mparam.h
mpz_inp_str.o : mpz_inp_str.c gmp.h gmp-impl.h gmp-mparam.h
mpz_ior.o : mpz_ior.c gmp.h gmp-impl.h gmp-mparam.h
mpz_iset.o : mpz_iset.c gmp.h gmp-impl.h gmp-mparam.h
mpz_iset_si.o : mpz_iset_si.c gmp.h gmp-impl.h gmp-mparam.h
mpz_iset_str.o : mpz_iset_str.c gmp.h gmp-impl.h gmp-mparam.h
mpz_iset_ui.o : mpz_iset_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mdiv.o : mpz_mdiv.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mdiv_ui.o : mpz_mdiv_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mdm.o : mpz_mdm.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mdm_ui.o : mpz_mdm_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mmod.o : mpz_mmod.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mmod_ui.o : mpz_mmod_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mod.o : mpz_mod.c gmp.h gmp-impl.h gmp-mparam.h longlong.h mpz_dmincl.c
mpz_mod_2exp.o : mpz_mod_2exp.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mod_ui.o : mpz_mod_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_mul.o : mpz_mul.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mul_2exp.o : mpz_mul_2exp.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mul_ui.o : mpz_mul_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_neg.o : mpz_neg.c gmp.h gmp-impl.h gmp-mparam.h
mpz_out_raw.o : mpz_out_raw.c gmp.h gmp-impl.h gmp-mparam.h
mpz_out_str.o : mpz_out_str.c gmp.h gmp-impl.h gmp-mparam.h
mpz_perfsqr.o : mpz_perfsqr.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_pow_ui.o : mpz_pow_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_powm.o : mpz_powm.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_powm_ui.o : mpz_powm_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_pprime_p.o : mpz_pprime_p.c gmp.h gmp-impl.h gmp-mparam.h
mpz_random.o : mpz_random.c gmp.h gmp-impl.h gmp-mparam.h
mpz_random2.o : mpz_random2.c gmp.h gmp-impl.h gmp-mparam.h
mpz_realloc.o : mpz_realloc.c gmp.h gmp-impl.h gmp-mparam.h
mpz_set.o : mpz_set.c gmp.h gmp-impl.h gmp-mparam.h
mpz_set_si.o : mpz_set_si.c gmp.h gmp-impl.h gmp-mparam.h
mpz_set_str.o : mpz_set_str.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_set_ui.o : mpz_set_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_size.o : mpz_size.c gmp.h gmp-impl.h gmp-mparam.h
mpz_sizeinb.o : mpz_sizeinb.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_sqrt.o : mpz_sqrt.c gmp.h gmp-impl.h gmp-mparam.h
mpz_sqrtrem.o : mpz_sqrtrem.c gmp.h gmp-impl.h gmp-mparam.h
mpz_sub.o : mpz_sub.c gmp.h gmp-impl.h gmp-mparam.h
mpz_sub_ui.o : mpz_sub_ui.c gmp.h gmp-impl.h gmp-mparam.h
mtox.o : mtox.c mp.h gmp.h gmp-impl.h gmp-mparam.h
sdiv.o : sdiv.c mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
xtom.o : xtom.c mp.h gmp.h gmp-impl.h gmp-mparam.h

View File

@ -1,5 +1,7 @@
/* cre-conv-tab.c -- Create conversion table in a wordsize-dependent way.
$Id$
Copyright (C) 1991 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@ -18,17 +20,14 @@ 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. */
#include <stdio.h>
#include <math.h>
#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
extern double floor ();
extern double log ();
static unsigned long int
upow (b, e)
unsigned long int b;
unsigned int e;
upow (unsigned long int b, unsigned int e)
{
unsigned long int y = 1;
@ -47,8 +46,7 @@ upow (b, e)
}
unsigned int
ulog2 (x)
unsigned long int x;
ulog2 (unsigned long int x)
{
unsigned int i;
for (i = 0; x != 0; i++)
@ -56,7 +54,8 @@ ulog2 (x)
return i;
}
main ()
void
main (void)
{
int i;
unsigned long idig;

View File

@ -1,5 +1,7 @@
/* cre-mparam.c -- Create machine-depedent parameter file.
$Id$
Copyright (C) 1991 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@ -18,11 +20,11 @@ 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. */
#include <stdio.h>
#include "gmp.h"
unsigned int
ulog2 (x)
unsigned long int x;
ulog2 (unsigned long int x)
{
unsigned int i;
for (i = 0; x != 0; i++)
@ -30,7 +32,8 @@ ulog2 (x)
return i;
}
main ()
void
main (void)
{
int i;

View File

@ -1,289 +1,96 @@
# Makefile for GNU MP (a.k.a. biGNUm)
# Copyright (C) 1991, 1993 Free Software Foundation, Inc.
# Makefile for libmp
# $Id$
# This file is part of the GNU MP Library.
LIB= mp
SRCS= $(MP_SRCS)
CLEANFILES+= cre-mparam cre-conv-tab gcd.c gmp-mparam.h mp_bases.c \
madd.c mcmp.c msqrt.c msub.c mult.c pow.c rpow.c
# 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.
MP_SRCS= $(BSDMP_SRCS) $(MPN_SRCS) $(IMPL_SRCS) mp_bases.c mpz_sizeinb.c
GMP_SRCS= $(MPZ_SRCS) $(MPQ_SRCS) $(MPN_SRCS) $(IMPL_SRCS) mp_bases.c
# 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.
CFLAGS+= -I${.CURDIR} -I${.OBJDIR} -Wall -Wstrict-prototypes -DLOCALE
# 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.
BSDMP_SRCS= gcd.c itom.c madd.c mcmp.c mdiv.c move.c msub.c mtox.c mult.c \
pow.c rpow.c xtom.c msqrt.c sdiv.c mout.c min.c mfree.c
CC = gcc
# 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 = -O -g
CFLAGS = -I. $(OPT)
AR = ar
RANLIB=`if [ -r /bin/ranlib -o -r /usr/bin/ranlib ]; \
then echo ranlib; else echo true; fi`
SHELL = /bin/sh
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) mp_bases.o mpz_sizeinb.o
GMP_OBJS = $(MPZ_OBJS) $(MPQ_OBJS) $(MPN_OBJS) $(IMPL_OBJS) mp_bases.o
IMPL_SRCS = memory.c mp_set_fns.c _mpz_set_str.c _mpz_get_str.c \
mpz_realloc.c mp_clz_tab.c alloca.c
IMPL_OBJS = memory.o mp_set_fns.o _mpz_set_str.o _mpz_get_str.o \
mpz_realloc.o mp_clz_tab.o alloca.o
MPZ_SRCS = mpz_init.c mpz_set.c mpz_set_ui.c mpz_set_si.c mpz_set_str.c \
mpz_iset.c mpz_iset_ui.c mpz_iset_si.c mpz_iset_str.c mpz_clear.c \
mpz_get_ui.c mpz_get_si.c mpz_get_str.c mpz_size.c mpz_sizeinb.c \
mpz_add.c mpz_add_ui.c mpz_sub.c mpz_sub_ui.c mpz_mul.c mpz_mul_ui.c \
mpz_div.c mpz_div_ui.c mpz_mod.c mpz_mod_ui.c mpz_dm.c mpz_dm_ui.c \
mpz_mdiv.c mpz_mmod.c mpz_mdm.c mpz_mdiv_ui.c mpz_mmod_ui.c mpz_mdm_ui.c \
mpz_gcd.c mpz_gcdext.c mpz_sqrt.c mpz_sqrtrem.c mpz_powm.c mpz_powm_ui.c \
mpz_cmp.c mpz_cmp_ui.c mpz_cmp_si.c mpz_mul_2exp.c mpz_div_2exp.c \
mpz_mod_2exp.c mpz_abs.c mpz_neg.c mpz_com.c mpz_and.c mpz_ior.c \
mpz_inp_raw.c mpz_inp_str.c mpz_out_raw.c mpz_out_str.c \
mpz_perfsqr.c mpz_random.c mpz_random2.c mpz_pow_ui.c \
mpz_clrbit.c mpz_fac_ui.c mpz_pprime_p.c
MPZ_OBJS = mpz_init.o mpz_set.o mpz_set_ui.o mpz_set_si.o mpz_set_str.o \
mpz_iset.o mpz_iset_ui.o mpz_iset_si.o mpz_iset_str.o mpz_clear.o \
mpz_get_ui.o mpz_get_si.o mpz_get_str.o mpz_size.o mpz_sizeinb.o \
mpz_add.o mpz_add_ui.o mpz_sub.o mpz_sub_ui.o mpz_mul.o mpz_mul_ui.o \
mpz_div.o mpz_div_ui.o mpz_mod.o mpz_mod_ui.o mpz_dm.o mpz_dm_ui.o \
mpz_mdiv.o mpz_mmod.o mpz_mdm.o mpz_mdiv_ui.o mpz_mmod_ui.o mpz_mdm_ui.o \
mpz_gcd.o mpz_gcdext.o mpz_sqrt.o mpz_sqrtrem.o mpz_powm.o mpz_powm_ui.o \
mpz_cmp.o mpz_cmp_ui.o mpz_cmp_si.o mpz_mul_2exp.o mpz_div_2exp.o \
mpz_mod_2exp.o mpz_abs.o mpz_neg.o mpz_com.o mpz_and.o mpz_ior.o \
mpz_inp_raw.o mpz_inp_str.o mpz_out_raw.o mpz_out_str.o \
mpz_perfsqr.o mpz_random.o mpz_random2.o mpz_pow_ui.o \
mpz_clrbit.o mpz_fac_ui.o mpz_pprime_p.o
MPQ_SRCS = mpq_init.c mpq_set.c mpq_set_ui.c mpq_set_si.c \
mpq_set_num.c mpq_set_den.c mpq_get_num.c mpq_get_den.c \
mpq_add.c mpq_sub.c mpq_mul.c mpq_div.c \
mpq_clear.c mpq_cmp.c mpq_inv.c mpq_neg.c
MPQ_OBJS = mpq_init.o mpq_set.o mpq_set_ui.o mpq_set_si.o \
mpq_set_num.o mpq_set_den.o mpq_get_num.o mpq_get_den.o \
mpq_add.o mpq_sub.o mpq_mul.o mpq_div.o \
mpq_clear.o mpq_cmp.o mpq_inv.o mpq_neg.o
MPN_SRCS = mpn_add.c mpn_sub.c mpn_cmp.c mpn_mul.c mpn_div.c mpn_dm_1.c \
MPN_SRCS= mpn_add.c mpn_sub.c mpn_cmp.c mpn_mul.c mpn_div.c mpn_dm_1.c \
mpn_mod_1.c mpn_lshift.c mpn_rshift.c mpn_rshiftci.c mpn_sqrt.c
MPN_OBJS = mpn_add.o mpn_sub.o mpn_cmp.o mpn_mul.o mpn_div.o mpn_dm_1.o \
mpn_mod_1.o mpn_lshift.o mpn_rshift.o mpn_rshiftci.o mpn_sqrt.o
# 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 = itom.c mdiv.c move.c mtox.c xtom.c sdiv.c mout.c min.c mfree.c
BSDMP_OBJS = 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.o
IMPL_SRCS= memory.c mp_set_fns.c _mpz_set_str.c _mpz_get_str.c \
mpz_realloc.c mp_clz_tab.c
all: libgmp.a libmp.a
MPZ_SRCS= mpz_init.c mpz_set.c mpz_set_ui.c mpz_set_si.c mpz_set_str.c \
mpz_iset.c mpz_iset_ui.c mpz_iset_si.c mpz_iset_str.c \
mpz_clear.c mpz_get_ui.c mpz_get_si.c mpz_get_str.c \
mpz_size.c mpz_sizeinb.c mpz_add.c mpz_add_ui.c mpz_sub.c \
mpz_sub_ui.c mpz_mul.c mpz_mul_ui.c mpz_div.c mpz_div_ui.c \
mpz_mod.c mpz_mod_ui.c mpz_dm.c mpz_dm_ui.c mpz_mdiv.c \
mpz_mmod.c mpz_mdm.c mpz_mdiv_ui.c mpz_mmod_ui.c mpz_mdm_ui.c \
mpz_gcd.c mpz_gcdext.c mpz_sqrt.c mpz_sqrtrem.c mpz_powm.c \
mpz_powm_ui.c mpz_cmp.c mpz_cmp_ui.c mpz_cmp_si.c \
mpz_mul_2exp.c mpz_div_2exp.c mpz_mod_2exp.c mpz_abs.c \
mpz_neg.c mpz_com.c mpz_and.c mpz_ior.c mpz_inp_raw.c \
mpz_inp_str.c mpz_out_raw.c mpz_out_str.c mpz_perfsqr.c \
mpz_random.c mpz_random2.c mpz_pow_ui.c mpz_clrbit.c \
mpz_fac_ui.c mpz_pprime_p.c
check: libgmp.a
cd tests; $(MAKE) CC="$(CC)" SHELL="$(SHELL)" OPT="$(OPT)"
MPQ_SRCS= mpq_init.c mpq_set.c mpq_set_ui.c mpq_set_si.c \
mpq_set_num.c mpq_set_den.c mpq_get_num.c mpq_get_den.c \
mpq_add.c mpq_sub.c mpq_mul.c mpq_div.c mpq_clear.c \
mpq_cmp.c mpq_inv.c mpq_neg.c
libgmp.a: stamp-stddefh $(GMP_OBJS)
rm -f $@
$(AR) cr $@ $(GMP_OBJS)
$(RANLIB) $@
beforedepend: gmp-mparam.h mp_bases.c
# libmp.a depend on libgmp.a, to get around Unix(tm) ar/ranlib concurrency bug.
libmp.a: stamp-stddefh $(MP_OBJS) libgmp.a
rm -f $@
$(AR) cr $@ $(MP_OBJS)
$(RANLIB) $@
beforeinstall:
cmp -s ${.CURDIR}/mp.h ${DESTDIR}/usr/include/mp.h || \
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/mp.h ${DESTDIR}/usr/include/mp.h
stamp-stddefh:
rm -f stddef.h
rm -f test-stddefh.c
( echo '#include <stddef.h>' ;\
echo 'main(){size_t foo=sizeof(size_t);exit(0);}' ;\
) > test-stddefh.c
@if $(LOCAL_CC) $(CFLAGS) test-stddefh.c -c 2> /dev/null ;\
then true ;\
else \
echo 'This machine has no "stddef.h". Creating a minimal in ./';\
$(LOCAL_CC) $(CFLAGS) cre-stddefh.c -o cre-stddefh ;\
./cre-stddefh > stddef.h ;\
fi
rm -f test-stddefh.o
touch stamp-stddefh
cre-mparam: cre-mparam.c
$(CC) $(CFLAGS) ${.OODATE} -o ${.TARGET}
mp_bases.c: cre-conv-tab
./cre-conv-tab > tmp-$@
mv tmp-$@ $@
cre-conv-tab: cre-conv-tab.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(LOCAL_CC) $(CFLAGS) `if [ x$(firstword $^) = x ]; \
then echo cre-conv-tab.c; \
else echo $(firstword $^); fi` -o $@ -lm
cre-conv-tab: cre-conv-tab.c
$(CC) $(CFLAGS) -lm ${.OODATE} -o ${.TARGET}
gmp-mparam.h: cre-mparam
./cre-mparam > tmp-$@
mv tmp-$@ $@
cre-mparam: cre-mparam.c stamp-stddefh gmp.h
$(LOCAL_CC) $(CFLAGS) cre-mparam.c -o $@
./cre-mparam > tmp-${.TARGET}
mv tmp-${.TARGET} ${.TARGET}
gcd.c : mpz_gcd.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_gcd.c \
| grep -v '^#' > $@
pow.c : mpz_powm.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_powm.c\
| grep -v '^#' > $@
rpow.c: mpz_pow_ui.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_pow_ui.c\
| grep -v '^#' > $@
madd.c : mpz_add.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_add.c\
| grep -v '^#' > $@
msub.c : mpz_sub.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_sub.c\
| grep -v '^#' > $@
mult.c : mpz_mul.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_mul.c\
| grep -v '^#' > $@
mcmp.c : mpz_cmp.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_cmp.c\
| grep -v '^#' > $@
msqrt.c : mpz_sqrtrem.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_sqrtrem.c\
| grep -v '^#' > $@
mp_bases.c: cre-conv-tab
./cre-conv-tab > tmp-${.TARGET}
mv tmp-${.TARGET} ${.TARGET}
doc: gmp.dvi gmp.info
LN = ln -s
gmp.dvi: gmp.texi
rm -f tmp.texi
$(LN) gmp.texi tmp.texi
tex tmp.texi < /dev/null
texindex tmp.cp tmp.fn
tex tmp.texi < /dev/null 2> /dev/null
mv tmp.dvi gmp.dvi
gmp.info: gmp.texi
makeinfo gmp.texi
gcd.c: mpz_gcd.c mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP ${.CURDIR}/mpz_gcd.c\
| grep -v '^#' > ${.TARGET}
clean:
rm -f *.o libgmp.a libmp.a cre-conv-tab cre-mparam cre-stddefh \
gmp.dvi gmp.info mp_bases.c gmp-mparam.h stamp-stddefh test-stddefh.c \
stddef.h gcd.c pow.c rpow.c madd.c msub.c mult.c mcmp.c msqrt.c \
tmp.* tmp-* gmp.ps core
-cd tests; $(MAKE) clean
realclean: clean
pow.c: mpz_powm.c mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP ${.CURDIR}/mpz_powm.c\
| grep -v '^#' > ${.TARGET}
# Automatically generated dependencies
rpow.c: mpz_pow_ui.c mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP ${.CURDIR}/mpz_pow_ui.c\
| grep -v '^#' > ${.TARGET}
_mpz_get_str.o : _mpz_get_str.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
_mpz_set_str.o : _mpz_set_str.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
cre-conv-tab.o : cre-conv-tab.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
cre-mparam.o : cre-mparam.c gmp.h
cre-stddefh.o : cre-stddefh.c
itom.o : itom.c mp.h gmp.h gmp-impl.h gmp-mparam.h
mdiv.o : mdiv.c mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h mpz_dmincl.c
memory.o : memory.c gmp.h gmp-impl.h gmp-mparam.h
mfree.o : mfree.c mp.h gmp.h gmp-impl.h gmp-mparam.h
min.o : min.c mp.h gmp.h gmp-impl.h gmp-mparam.h
mout.o : mout.c mp.h gmp.h gmp-impl.h gmp-mparam.h
move.o : move.c mp.h gmp.h gmp-impl.h gmp-mparam.h
mp_bases.o : mp_bases.c gmp.h gmp-impl.h gmp-mparam.h
mp_clz_tab.o : mp_clz_tab.c gmp.h gmp-impl.h gmp-mparam.h
mp_set_fns.o : mp_set_fns.c gmp.h gmp-impl.h gmp-mparam.h
mpn_add.o : mpn_add.c gmp.h gmp-impl.h gmp-mparam.h
mpn_cmp.o : mpn_cmp.c gmp.h gmp-impl.h gmp-mparam.h
mpn_div.o : mpn_div.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpn_dm_1.o : mpn_dm_1.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpn_lshift.o : mpn_lshift.c gmp.h gmp-impl.h gmp-mparam.h
mpn_mod_1.o : mpn_mod_1.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpn_mul.o : mpn_mul.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpn_rshift.o : mpn_rshift.c gmp.h gmp-impl.h gmp-mparam.h
mpn_rshiftci.o : mpn_rshiftci.c gmp.h gmp-impl.h gmp-mparam.h
mpn_sqrt.o : mpn_sqrt.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpn_sub.o : mpn_sub.c gmp.h gmp-impl.h gmp-mparam.h
mpq_add.o : mpq_add.c gmp.h gmp-impl.h gmp-mparam.h
mpq_clear.o : mpq_clear.c gmp.h gmp-impl.h gmp-mparam.h
mpq_cmp.o : mpq_cmp.c gmp.h gmp-impl.h gmp-mparam.h
mpq_div.o : mpq_div.c gmp.h gmp-impl.h gmp-mparam.h
mpq_get_den.o : mpq_get_den.c gmp.h gmp-impl.h gmp-mparam.h
mpq_get_num.o : mpq_get_num.c gmp.h gmp-impl.h gmp-mparam.h
mpq_init.o : mpq_init.c gmp.h gmp-impl.h gmp-mparam.h
mpq_inv.o : mpq_inv.c gmp.h gmp-impl.h gmp-mparam.h
mpq_mul.o : mpq_mul.c gmp.h gmp-impl.h gmp-mparam.h
mpq_neg.o : mpq_neg.c gmp.h gmp-impl.h gmp-mparam.h
mpq_set.o : mpq_set.c gmp.h gmp-impl.h gmp-mparam.h
mpq_set_den.o : mpq_set_den.c gmp.h gmp-impl.h gmp-mparam.h
mpq_set_num.o : mpq_set_num.c gmp.h gmp-impl.h gmp-mparam.h
mpq_set_si.o : mpq_set_si.c gmp.h gmp-impl.h gmp-mparam.h
mpq_set_ui.o : mpq_set_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpq_sub.o : mpq_sub.c gmp.h gmp-impl.h gmp-mparam.h
mpz_abs.o : mpz_abs.c gmp.h gmp-impl.h gmp-mparam.h
mpz_add.o : mpz_add.c gmp.h gmp-impl.h gmp-mparam.h
mpz_add_ui.o : mpz_add_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_and.o : mpz_and.c gmp.h gmp-impl.h gmp-mparam.h
mpz_clear.o : mpz_clear.c gmp.h gmp-impl.h gmp-mparam.h
mpz_clrbit.o : mpz_clrbit.c gmp.h gmp-impl.h gmp-mparam.h
mpz_cmp.o : mpz_cmp.c gmp.h gmp-impl.h gmp-mparam.h
mpz_cmp_si.o : mpz_cmp_si.c gmp.h gmp-impl.h gmp-mparam.h
mpz_cmp_ui.o : mpz_cmp_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_com.o : mpz_com.c gmp.h gmp-impl.h gmp-mparam.h
mpz_div.o : mpz_div.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_div_2exp.o : mpz_div_2exp.c gmp.h gmp-impl.h gmp-mparam.h
mpz_div_ui.o : mpz_div_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_dm.o : mpz_dm.c gmp.h gmp-impl.h gmp-mparam.h longlong.h mpz_dmincl.c
mpz_dm_ui.o : mpz_dm_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_fac_ui.o : mpz_fac_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_gcd.o : mpz_gcd.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_gcdext.o : mpz_gcdext.c gmp.h gmp-impl.h gmp-mparam.h
mpz_get_si.o : mpz_get_si.c gmp.h gmp-impl.h gmp-mparam.h
mpz_get_str.o : mpz_get_str.c gmp.h gmp-impl.h gmp-mparam.h
mpz_get_ui.o : mpz_get_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_init.o : mpz_init.c gmp.h gmp-impl.h gmp-mparam.h
mpz_inp_raw.o : mpz_inp_raw.c gmp.h gmp-impl.h gmp-mparam.h
mpz_inp_str.o : mpz_inp_str.c gmp.h gmp-impl.h gmp-mparam.h
mpz_ior.o : mpz_ior.c gmp.h gmp-impl.h gmp-mparam.h
mpz_iset.o : mpz_iset.c gmp.h gmp-impl.h gmp-mparam.h
mpz_iset_si.o : mpz_iset_si.c gmp.h gmp-impl.h gmp-mparam.h
mpz_iset_str.o : mpz_iset_str.c gmp.h gmp-impl.h gmp-mparam.h
mpz_iset_ui.o : mpz_iset_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mdiv.o : mpz_mdiv.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mdiv_ui.o : mpz_mdiv_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mdm.o : mpz_mdm.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mdm_ui.o : mpz_mdm_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mmod.o : mpz_mmod.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mmod_ui.o : mpz_mmod_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mod.o : mpz_mod.c gmp.h gmp-impl.h gmp-mparam.h longlong.h mpz_dmincl.c
mpz_mod_2exp.o : mpz_mod_2exp.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mod_ui.o : mpz_mod_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_mul.o : mpz_mul.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mul_2exp.o : mpz_mul_2exp.c gmp.h gmp-impl.h gmp-mparam.h
mpz_mul_ui.o : mpz_mul_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_neg.o : mpz_neg.c gmp.h gmp-impl.h gmp-mparam.h
mpz_out_raw.o : mpz_out_raw.c gmp.h gmp-impl.h gmp-mparam.h
mpz_out_str.o : mpz_out_str.c gmp.h gmp-impl.h gmp-mparam.h
mpz_perfsqr.o : mpz_perfsqr.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_pow_ui.o : mpz_pow_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_powm.o : mpz_powm.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_powm_ui.o : mpz_powm_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_pprime_p.o : mpz_pprime_p.c gmp.h gmp-impl.h gmp-mparam.h
mpz_random.o : mpz_random.c gmp.h gmp-impl.h gmp-mparam.h
mpz_random2.o : mpz_random2.c gmp.h gmp-impl.h gmp-mparam.h
mpz_realloc.o : mpz_realloc.c gmp.h gmp-impl.h gmp-mparam.h
mpz_set.o : mpz_set.c gmp.h gmp-impl.h gmp-mparam.h
mpz_set_si.o : mpz_set_si.c gmp.h gmp-impl.h gmp-mparam.h
mpz_set_str.o : mpz_set_str.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_set_ui.o : mpz_set_ui.c gmp.h gmp-impl.h gmp-mparam.h
mpz_size.o : mpz_size.c gmp.h gmp-impl.h gmp-mparam.h
mpz_sizeinb.o : mpz_sizeinb.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
mpz_sqrt.o : mpz_sqrt.c gmp.h gmp-impl.h gmp-mparam.h
mpz_sqrtrem.o : mpz_sqrtrem.c gmp.h gmp-impl.h gmp-mparam.h
mpz_sub.o : mpz_sub.c gmp.h gmp-impl.h gmp-mparam.h
mpz_sub_ui.o : mpz_sub_ui.c gmp.h gmp-impl.h gmp-mparam.h
mtox.o : mtox.c mp.h gmp.h gmp-impl.h gmp-mparam.h
sdiv.o : sdiv.c mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
xtom.o : xtom.c mp.h gmp.h gmp-impl.h gmp-mparam.h
madd.c: mpz_add.c mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP ${.CURDIR}/mpz_add.c\
| grep -v '^#' > ${.TARGET}
msub.c: mpz_sub.c mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP ${.CURDIR}/mpz_sub.c\
| grep -v '^#' > ${.TARGET}
mult.c: mpz_mul.c mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP ${.CURDIR}/mpz_mul.c\
| grep -v '^#' > ${.TARGET}
mcmp.c: mpz_cmp.c mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP ${.CURDIR}/mpz_cmp.c\
| grep -v '^#' > ${.TARGET}
msqrt.c: mpz_sqrtrem.c mp.h gmp.h gmp-impl.h gmp-mparam.h
$(CC) $(CFLAGS) -E -DBERKELEY_MP ${.CURDIR}/mpz_sqrtrem.c\
| grep -v '^#' > ${.TARGET}
.include <bsd.lib.mk>