1996-10-20 09:29:39 +00:00
|
|
|
#
|
1998-08-30 01:57:55 +00:00
|
|
|
# $Id: Makefile,v 1.15 1998/05/15 06:42:37 jb Exp $
|
1996-10-20 09:29:39 +00:00
|
|
|
#
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1996-10-20 09:29:39 +00:00
|
|
|
LIB= mp
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1996-10-20 09:29:39 +00:00
|
|
|
GMPDIR= ${.CURDIR}/../../../contrib/libgmp
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1998-01-25 09:45:00 +00:00
|
|
|
.if ${MACHINE_ARCH} == "alpha"
|
|
|
|
.PATH: ${GMPDIR} ${GMPDIR}/mpn ${GMPDIR}/mpn/alpha ${GMPDIR}/mpn/generic \
|
|
|
|
${GMPDIR}/mpbsd
|
|
|
|
|
|
|
|
CFLAGS+= -I${GMPDIR}/mpn/alpha -I${GMPDIR}/mpz -DBERKELEY_MP
|
|
|
|
|
|
|
|
MPN_SRC_ASM= add_n.s addmul_1.s lshift.s mul_1.s rshift.s sub_n.s submul_1.s udiv_qrnnd.S
|
|
|
|
|
|
|
|
.elif ${MACHINE_ARCH} == "i386"
|
|
|
|
.PATH: ${GMPDIR} ${GMPDIR}/mpn ${GMPDIR}/mpn/x86 ${GMPDIR}/mpn/generic \
|
|
|
|
${GMPDIR}/mpbsd
|
|
|
|
|
|
|
|
CFLAGS+= -I${GMPDIR}/mpn/x86 -I${GMPDIR}/mpz -DBERKELEY_MP
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1996-10-20 09:29:39 +00:00
|
|
|
MPN_SRC_ASM= add_n.S addmul_1.S lshift.S mul_1.S rshift.S sub_n.S submul_1.S
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1998-01-25 09:45:00 +00:00
|
|
|
.elif ${MACHINE_ARCH} == "m68k"
|
|
|
|
.PATH: ${GMPDIR} ${GMPDIR}/mpn ${GMPDIR}/mpn/m68k ${GMPDIR}/mpn/generic \
|
|
|
|
${GMPDIR}/mpbsd
|
|
|
|
|
|
|
|
CFLAGS+= -I${GMPDIR}/mpn/m68k -I${GMPDIR}/mpz -DBERKELEY_MP
|
|
|
|
|
|
|
|
MPN_SRC_ASM= add_n.S lshift.S rshift.S sub_n.S
|
|
|
|
|
|
|
|
.endif
|
|
|
|
|
1998-05-15 06:42:37 +00:00
|
|
|
CFLAGS+= -I${GMPDIR} -I${GMPDIR}/mpn/generic
|
|
|
|
|
1998-01-25 09:45:00 +00:00
|
|
|
MPN_SRC_C= add_n.c addmul_1.c bdivmod.c cmp.c divmod_1.c divrem.c \
|
|
|
|
divrem_1.c dump.c gcd.c gcd_1.c gcdext.c get_str.c hamdist.c \
|
|
|
|
inlines.c lshift.c mod_1.c mul.c mul_1.c mul_n.c perfsqr.c \
|
|
|
|
popcount.c pre_mod_1.c random2.c rshift.c scan0.c scan1.c \
|
|
|
|
set_str.c sqrtrem.c mp_bases.c
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1996-10-20 09:29:39 +00:00
|
|
|
MPBSD_LINKS= mpz/add.c mpz/cmp.c mpz/gcd.c mpz/mul.c mpz/pow_ui.c \
|
1996-12-07 13:03:29 +00:00
|
|
|
mpz/powm.c mpz/sqrtrem.c mpz/sub.c mpz/realloc.c
|
1996-10-20 09:29:39 +00:00
|
|
|
MPBSD_SRCS= itom.c mdiv.c mfree.c min.c mout.c move.c mtox.c sdiv.c xtom.c \
|
|
|
|
realloc.c $(MPBSD_LINKS)
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1996-10-20 09:29:39 +00:00
|
|
|
SRCS= memory.c mp_set_fns.c mp_clz_tab.c version.c stack-alloc.c \
|
|
|
|
mp_bpl.c extract-double.c insert-double.c \
|
1998-03-12 13:03:06 +00:00
|
|
|
${MPN_SRC_ASM} \
|
|
|
|
asm-syntax.h sysdep.h
|
1998-01-25 09:45:00 +00:00
|
|
|
|
|
|
|
# Look though the generic C source for names that don't have assembly
|
|
|
|
# source version.
|
|
|
|
.for _src in ${MPN_SRC_C}
|
|
|
|
.if (${MPN_SRC_ASM:R:M${_src:R}} == "")
|
|
|
|
SRCS+=$(_src)
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
SRCS+= ${MPBSD_SRCS}
|
1996-10-20 09:29:39 +00:00
|
|
|
|
1998-03-12 13:03:06 +00:00
|
|
|
beforedepend all: mpz
|
1996-10-24 18:03:53 +00:00
|
|
|
|
1998-08-30 01:57:55 +00:00
|
|
|
.if defined(OBJFORMAT) && ${OBJFORMAT} == elf
|
1997-08-29 13:58:08 +00:00
|
|
|
|
|
|
|
sysdep.h: ${GMPDIR}/mpn/sysv.h
|
|
|
|
cp ${GMPDIR}/mpn/sysv.h sysdep.h
|
|
|
|
|
|
|
|
asm-syntax.h:
|
|
|
|
(echo "#define ELF_SYNTAX" ; \
|
|
|
|
echo "#include \"syntax.h\"") > asm-syntax.h
|
|
|
|
.else
|
|
|
|
|
1996-10-24 18:03:53 +00:00
|
|
|
sysdep.h: ${GMPDIR}/mpn/bsd.h
|
1996-10-20 09:29:39 +00:00
|
|
|
cp ${GMPDIR}/mpn/bsd.h sysdep.h
|
1996-10-24 18:03:53 +00:00
|
|
|
|
|
|
|
asm-syntax.h:
|
1996-10-20 09:29:39 +00:00
|
|
|
(echo "#define BSD_SYNTAX" ; \
|
|
|
|
echo "#include \"syntax.h\"") > asm-syntax.h
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1997-08-29 13:58:08 +00:00
|
|
|
CFLAGS+= -DBROKEN_ALIGN
|
|
|
|
|
|
|
|
.endif
|
|
|
|
|
1996-10-20 09:29:39 +00:00
|
|
|
CLEANFILES+= sysdep.h asm-syntax.h
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1996-10-20 09:29:39 +00:00
|
|
|
# Grrr. This package contains modules in separate subdirs that have the
|
|
|
|
# same name. Nasty hack to keep them from being found by being in
|
|
|
|
# .PATH:s
|
|
|
|
#
|
1996-10-24 18:03:53 +00:00
|
|
|
mpz:
|
1997-04-10 16:33:32 +00:00
|
|
|
mkdir ${.TARGET}
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1996-10-20 09:29:39 +00:00
|
|
|
CLEANDIRS+= ${.OBJDIR}/mpz ${.CURDIR}/mpz
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1996-10-20 09:29:39 +00:00
|
|
|
beforeinstall:
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${GMPDIR}/mp.h ${DESTDIR}/usr/include
|
1995-11-12 14:40:41 +00:00
|
|
|
|
1996-10-20 09:29:39 +00:00
|
|
|
.include "../libgmp/Makefile.inc"
|
1995-11-12 14:55:48 +00:00
|
|
|
.include <bsd.lib.mk>
|