VM: munmap used by VM for itself is no longer used
[minix.git] / external / lgpl3 / gmp / lib / libgmp / Makefile
blobb07d5dddd7865d6a109062703c19fcc2815d63ee
1 # $NetBSD: Makefile,v 1.12 2011/09/21 02:06:42 mrg Exp $
3 .include <bsd.init.mk>
5 # We don't install gmp, just provide it for GCC.
6 LIBISPRIVATE?= yes
8 .if ${LIBISPRIVATE} != "yes"
9 INCS= gmp.h
10 INCSDIR= /usr/include
11 .endif
13 DIST=${.CURDIR}/../../dist
15 LIB= gmp
17 MPF_SRCS = \
18 init.c init2.c inits.c set.c \
19 set_ui.c set_si.c set_str.c set_d.c \
20 set_z.c iset.c iset_ui.c iset_si.c \
21 iset_str.c iset_d.c clear.c clears.c \
22 get_str.c dump.c size.c eq.c reldiff.c \
23 sqrt.c random2.c inp_str.c out_str.c \
24 add.c add_ui.c sub.c sub_ui.c ui_sub.c \
25 mul.c mul_ui.c div.c div_ui.c \
26 cmp.c cmp_d.c cmp_ui.c cmp_si.c \
27 mul_2exp.c div_2exp.c abs.c neg.c \
28 set_q.c get_d.c get_d_2exp.c set_dfl_prec.c \
29 set_prc.c set_prc_raw.c get_dfl_prec.c \
30 get_prc.c ui_div.c sqrt_ui.c \
31 ceilfloor.c trunc.c pow_ui.c \
32 urandomb.c swap.c \
33 fits_sint.c fits_slong.c fits_sshort.c \
34 fits_uint.c fits_ulong.c fits_ushort.c \
35 get_si.c get_ui.c \
36 int_p.c
38 MPZ_SRCS = \
39 abs.c add.c add_ui.c \
40 aorsmul.c aorsmul_i.c and.c array_init.c \
41 bin_ui.c bin_uiui.c \
42 cdiv_q.c cdiv_q_ui.c \
43 cdiv_qr.c cdiv_qr_ui.c \
44 cdiv_r.c cdiv_r_ui.c cdiv_ui.c \
45 cfdiv_q_2exp.c cfdiv_r_2exp.c \
46 clear.c clears.c clrbit.c \
47 cmp.c cmp_d.c cmp_si.c cmp_ui.c \
48 cmpabs.c cmpabs_d.c cmpabs_ui.c \
49 com.c combit.c \
50 cong.c cong_2exp.c cong_ui.c \
51 divexact.c divegcd.c dive_ui.c \
52 divis.c divis_ui.c divis_2exp.c dump.c \
53 export.c fac_ui.c fdiv_q.c \
54 fdiv_q_ui.c fdiv_qr.c fdiv_qr_ui.c \
55 fdiv_r.c fdiv_r_ui.c \
56 fdiv_ui.c fib_ui.c fib2_ui.c fits_sint.c \
57 fits_slong.c fits_sshort.c fits_uint.c \
58 fits_ulong.c fits_ushort.c gcd.c \
59 gcd_ui.c gcdext.c get_d.c get_d_2exp.c \
60 get_si.c get_str.c get_ui.c getlimbn.c \
61 hamdist.c \
62 import.c init.c init2.c inits.c \
63 inp_raw.c inp_str.c invert.c \
64 ior.c iset.c iset_d.c iset_si.c \
65 iset_str.c iset_ui.c jacobi.c kronsz.c \
66 kronuz.c kronzs.c kronzu.c \
67 lcm.c lcm_ui.c lucnum_ui.c lucnum2_ui.c \
68 millerrabin.c mod.c mul.c mul_2exp.c \
69 mul_si.c mul_ui.c \
70 n_pow_ui.c neg.c nextprime.c \
71 out_raw.c out_str.c perfpow.c perfsqr.c \
72 popcount.c pow_ui.c powm.c powm_sec.c \
73 powm_ui.c pprime_p.c random.c random2.c \
74 realloc.c realloc2.c remove.c \
75 root.c rootrem.c rrandomb.c scan0.c \
76 scan1.c set.c set_d.c set_f.c \
77 set_q.c set_si.c set_str.c set_ui.c \
78 setbit.c \
79 size.c sizeinbase.c sqrt.c \
80 sqrtrem.c sub.c sub_ui.c swap.c \
81 tdiv_ui.c tdiv_q.c tdiv_q_2exp.c \
82 tdiv_q_ui.c tdiv_qr.c tdiv_qr_ui.c \
83 tdiv_r.c tdiv_r_2exp.c tdiv_r_ui.c \
84 tstbit.c ui_pow_ui.c ui_sub.c urandomb.c \
85 urandomm.c xor.c
87 MPQ_SRCS = \
88 abs.c aors.c \
89 canonicalize.c clear.c clears.c \
90 cmp.c cmp_si.c cmp_ui.c div.c \
91 get_d.c get_den.c get_num.c get_str.c \
92 init.c inits.c inp_str.c inv.c \
93 md_2exp.c mul.c neg.c out_str.c \
94 set.c set_den.c set_num.c \
95 set_si.c set_str.c set_ui.c \
96 equal.c set_z.c set_d.c \
97 set_f.c swap.c
99 MPN_GENERIC_SRCS = \
100 popcount.c \
101 hamdist.c
103 PRINTF_SRCS = \
104 asprintf.c asprntffuns.c \
105 doprnt.c doprntf.c doprnti.c \
106 fprintf.c \
107 obprintf.c obvprintf.c obprntffuns.c \
108 printf.c printffuns.c \
109 snprintf.c snprntffuns.c \
110 sprintf.c sprintffuns.c \
111 vasprintf.c vfprintf.c vprintf.c \
112 vsnprintf.c vsprintf.c \
113 repl-vsnprintf.c
115 SCANF_SRCS = \
116 doscan.c fscanf.c fscanffuns.c \
117 scanf.c sscanf.c sscanffuns.c \
118 vfscanf.c vscanf.c vsscanf.c
120 SRCS+= \
121 assert.c compat.c errno.c extract-dbl.c invalid.c memory.c \
122 mp_bpl.c mp_clz_tab.c mp_dv_tab.c mp_minv_tab.c mp_get_fns.c \
123 mp_set_fns.c rand.c randclr.c randdef.c randiset.c randlc2s.c \
124 randlc2x.c randmt.c randmts.c rands.c randsd.c randsdui.c \
125 randbui.c randmui.c version.c nextprime.c
127 SRCS+= tal-reent.c
129 # these are generated
130 SRCS+= fib_table.c mp_bases.c
132 # Build the files that may have multiple identical base names under
133 # different names.
134 .for _dir _srcfile in \
135 ${MPF_SRCS:C/^/mpf /} \
136 ${MPZ_SRCS:C/^/mpz /} \
137 ${MPQ_SRCS:C/^/mpq /} \
138 ${PRINTF_SRCS:C/^/printf /} \
139 ${SCANF_SRCS:C/^/scanf /}
140 ${_dir}_${_srcfile}: #Makefile
141 echo '#include "'${_dir}/${_srcfile}'"' > ${.TARGET}
143 SRCS+= ${_dir}_${_srcfile}
144 CLEANFILES+= ${_dir}_${_srcfile}
146 .endfor
148 CPPFLAGS+= -I. -I${DIST} -I${.CURDIR}/arch/${MACHINE_ARCH} -D__GMP_WITHIN_GMP -DHAVE_CONFIG_H
150 WITHOUT_MAN= yes
152 DPSRCS= fac_ui.h fib_table.h fib_table.c mp_bases.h mp_bases.c perfsqr.h
154 fac_ui.h: gen-fac_ui.c
155 ${HOST_CC} -o ${.OBJDIR}/gen-fac_ui ${.ALLSRC}
156 ${.OBJDIR}/gen-fac_ui ${GMP_LIMB_BITS} 0 > ${.OBJDIR}/fac_ui.h
158 gen-fib: gen-fib.c
159 ${HOST_CC} -o ${.OBJDIR}/gen-fib ${.ALLSRC}
161 fib_table.h: gen-fib
162 ${.OBJDIR}/gen-fib header ${GMP_LIMB_BITS} 0 > ${.OBJDIR}/fib_table.h
164 fib_table.c: gen-fib
165 ${.OBJDIR}/gen-fib table ${GMP_LIMB_BITS} 0 > ${.OBJDIR}/fib_table.c
167 gen-bases: gen-bases.c
168 ${HOST_CC} -o ${.OBJDIR}/gen-bases ${.ALLSRC} -lm
170 mp_bases.h: gen-bases
171 ${.OBJDIR}/gen-bases header ${GMP_LIMB_BITS} 0 > ${.OBJDIR}/mp_bases.h
173 mp_bases.c: gen-bases
174 ${.OBJDIR}/gen-bases table ${GMP_LIMB_BITS} 0 > ${.OBJDIR}/mp_bases.c
176 perfsqr.h: gen-psqr.c
177 ${HOST_CC} -o ${.OBJDIR}/gen-psqr ${.ALLSRC}
178 ${.OBJDIR}/gen-psqr ${GMP_LIMB_BITS} 0 > ${.OBJDIR}/perfsqr.h
180 CLEANFILES+= ${DPSRCS} gen-fac_ui gen-fib gen-bases gen-psqr gen-trialdivtab
182 .include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc"
184 .include <bsd.lib.mk>
186 .PATH: ${DIST} \
187 ${DIST}/mpn/generic \
188 ${.CURDIR}/arch/${MACHINE_ARCH} \
189 ${DIST}/mpf \
190 ${DIST}/mpz
192 # Don't warn about functions which cannot be stack smash protected as
193 # there are a lot of them.
194 .if defined(HAVE_GCC) || defined(HAVE_PCC)
195 COPTS += -Wno-stack-protector
196 .endif
198 CWARNFLAGS.clang+= -Wno-unused-value -Wno-tautological-compare