2 # $Id: Makefile,v 1.20 1998/12/16 04:59:53 imp Exp $
9 GMPDIR= ${.CURDIR}/../../../contrib/libgmp
10 .PATH: ${GMPDIR} ${GMPDIR}/mpn
12 .if ${MACHINE_ARCH} == "alpha"
13 .PATH: ${GMPDIR}/mpn/alpha ${GMPDIR}/mpn/generic
15 CFLAGS+= -I${GMPDIR}/mpn/alpha
17 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
19 .elif ${MACHINE_ARCH} == "i386"
20 .PATH: ${GMPDIR}/mpn/x86 ${GMPDIR}/mpn/generic
22 CFLAGS+= -I${GMPDIR}/mpn/x86
24 MPN_SRC_ASM= add_n.S addmul_1.S lshift.S mul_1.S rshift.S sub_n.S submul_1.S
26 .elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
27 .PATH: ${GMPDIR}/mpn/mips3 ${GMPDIR}/mpn/generic
29 CFLAGS+= -I${GMPDIR}/mpn/mips3
31 MPN_SRC_ASM= add_n.s addmul_1.s lshift.s mul_1.s rshift.s sub_n.s submul_1.s
33 .elif ${MACHINE_ARCH} == "m68k"
34 .PATH: ${GMPDIR}/mpn/m68k ${GMPDIR}/mpn/generic
36 CFLAGS+= -I${GMPDIR}/mpn/m68k
38 MPN_SRC_ASM= add_n.S lshift.S rshift.S sub_n.S
42 CFLAGS+= -I${GMPDIR} -I${GMPDIR}/mpn/generic
44 MPN_SRC_C= add_n.c addmul_1.c bdivmod.c cmp.c divmod_1.c divrem.c \
45 divrem_1.c dump.c gcd.c gcd_1.c gcdext.c get_str.c hamdist.c \
46 inlines.c lshift.c mod_1.c mul.c mul_1.c mul_n.c perfsqr.c \
47 popcount.c pre_mod_1.c random2.c rshift.c scan0.c scan1.c \
48 set_str.c sqrtrem.c mp_bases.c
50 MPZ_SRCS= mpz/init.c mpz/set.c mpz/set_ui.c mpz/set_si.c mpz/set_str.c \
51 mpz/set_d.c mpz/set_f.c mpz/set_q.c mpz/iset.c mpz/iset_ui.c \
52 mpz/iset_si.c mpz/iset_str.c mpz/iset_d.c mpz/clear.c \
53 mpz/get_ui.c mpz/get_si.c mpz/get_str.c mpz/get_d.c \
54 mpz/size.c mpz/sizeinbase.c mpz/add.c mpz/add_ui.c \
55 mpz/sub.c mpz/sub_ui.c mpz/mul.c mpz/mul_ui.c mpz/gcd.c \
56 mpz/gcd_ui.c mpz/gcdext.c mpz/sqrt.c mpz/sqrtrem.c \
57 mpz/powm.c mpz/powm_ui.c mpz/cmp.c mpz/cmp_ui.c mpz/cmp_si.c \
58 mpz/mul_2exp.c mpz/fdiv_q_2exp.c mpz/fdiv_r_2exp.c \
59 mpz/tdiv_q_2exp.c mpz/tdiv_r_2exp.c mpz/abs.c mpz/neg.c \
60 mpz/com.c mpz/and.c mpz/ior.c mpz/inp_raw.c mpz/inp_str.c \
61 mpz/out_raw.c mpz/out_str.c mpz/perfsqr.c mpz/random.c \
62 mpz/random2.c mpz/pow_ui.c mpz/ui_pow_ui.c mpz/setbit.c \
63 mpz/clrbit.c mpz/fac_ui.c mpz/pprime_p.c mpz/realloc.c \
64 mpz/getlimbn.c mpz/popcount.c mpz/hamdist.c mpz/cdiv_qr.c \
65 mpz/cdiv_q.c mpz/cdiv_r.c mpz/cdiv_qr_ui.c mpz/cdiv_q_ui.c \
66 mpz/cdiv_r_ui.c mpz/cdiv_ui.c mpz/fdiv_qr.c mpz/fdiv_q.c \
67 mpz/fdiv_r.c mpz/fdiv_qr_ui.c mpz/fdiv_q_ui.c mpz/fdiv_r_ui.c \
68 mpz/fdiv_ui.c mpz/tdiv_qr.c mpz/tdiv_q.c mpz/tdiv_r.c \
69 mpz/tdiv_qr_ui.c mpz/tdiv_q_ui.c mpz/tdiv_r_ui.c mpz/mod.c \
70 mpz/divexact.c mpz/array_init.c mpz/scan0.c mpz/scan1.c \
71 mpz/jacobi.c mpz/legendre.c mpz/invert.c
73 MPF_SRCS= mpf/init.c mpf/init2.c mpf/set.c mpf/set_ui.c mpf/set_si.c \
74 mpf/set_str.c mpf/set_d.c mpf/set_z.c mpf/iset.c \
75 mpf/iset_ui.c mpf/iset_si.c mpf/iset_str.c mpf/iset_d.c \
76 mpf/clear.c mpf/get_str.c mpf/dump.c mpf/size.c mpf/eq.c \
77 mpf/reldiff.c mpf/sqrt.c mpf/random2.c mpf/inp_str.c \
78 mpf/out_str.c mpf/add.c mpf/add_ui.c mpf/sub.c mpf/sub_ui.c \
79 mpf/ui_sub.c mpf/mul.c mpf/mul_ui.c mpf/div.c mpf/div_ui.c \
80 mpf/cmp.c mpf/cmp_ui.c mpf/cmp_si.c mpf/mul_2exp.c \
81 mpf/div_2exp.c mpf/abs.c mpf/neg.c mpf/set_q.c mpf/get_d.c \
82 mpf/set_dfl_prec.c mpf/set_prc.c mpf/set_prc_raw.c \
83 mpf/get_prc.c mpf/ui_div.c mpf/sqrt_ui.c
85 MPQ_SRCS= mpq/add.c mpq/canonicalize.c mpq/clear.c mpq/cmp.c \
86 mpq/cmp_ui.c mpq/div.c mpq/get_d.c mpq/get_den.c mpq/get_num.c \
87 mpq/init.c mpq/inv.c mpq/mul.c mpq/neg.c mpq/set.c \
88 mpq/set_den.c mpq/set_num.c mpq/set_si.c mpq/set_ui.c \
89 mpq/sub.c mpq/equal.c mpq/set_z.c
91 SRCS= memory.c mp_set_fns.c mp_clz_tab.c version.c stack-alloc.c mp_bpl.c \
92 extract-double.c insert-double.c \
96 # Look though the generic C source for names that don't have assembly
98 .for _src in ${MPN_SRC_C}
99 .if (${MPN_SRC_ASM:R:M${_src:R}} == "")
104 SRCS+= ${MPZ_SRCS} ${MPF_SRCS} ${MPQ_SRCS}
106 .if defined(OBJFORMAT) && ${OBJFORMAT} == elf
108 sysdep.h: ${GMPDIR}/mpn/sysv.h
109 cp ${GMPDIR}/mpn/sysv.h sysdep.h
112 (echo "#define ELF_SYNTAX" ; \
113 echo "#include \"syntax.h\"") > asm-syntax.h
116 sysdep.h: ${GMPDIR}/mpn/bsd.h
117 cp ${GMPDIR}/mpn/bsd.h sysdep.h
120 (echo "#define BSD_SYNTAX" ; \
121 echo "#include \"syntax.h\"") > asm-syntax.h
123 CFLAGS+= -DBROKEN_ALIGN
127 beforedepend all: mpz mpf mpq
129 CLEANFILES+= sysdep.h asm-syntax.h
131 # Grrr. This package contains modules in separate subdirs that have the
132 # same name. Nasty hack to keep them from being found by being in
138 CLEANDIRS+= ${.OBJDIR}/mpz \
143 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
144 ${GMPDIR}/gmp.h ${DESTDIR}/usr/include
146 .include "Makefile.inc"
147 .include <bsd.lib.mk>