1#         $NetBSD: Makefile,v 1.8 2025/04/06 23:03:05 rillig Exp $
2
3.include <bsd.init.mk>
4
5# We don't install mpc, just provide it for GCC.
6LIBISPRIVATE?= yes
7
8.if ${LIBISPRIVATE} != "yes"
9INCS=         mpc.h mpc-log.h
10INCSDIR=      /usr/include
11.endif
12
13LIB=      mpc
14
15LIBDPLIBS+= gmp ${.CURDIR}/../../../../lgpl3/gmp/lib/libgmp
16LIBDPLIBS+= mpfr ${.CURDIR}/../../../../lgpl3/mpfr/lib/libmpfr
17
18SRCS=     \
19          abs.c \
20          acos.c \
21          acosh.c \
22          add.c \
23          add_fr.c \
24          add_si.c \
25          add_ui.c \
26          agm.c \
27          arg.c \
28          asin.c \
29          asinh.c \
30          atan.c \
31          atanh.c \
32          balls.c \
33          clear.c \
34          cmp.c \
35          cmp_abs.c \
36          cmp_si_si.c \
37          conj.c \
38          cos.c \
39          cosh.c \
40          div_2si.c \
41          div_2ui.c \
42          div.c \
43          div_fr.c \
44          div_ui.c \
45          dot.c \
46          eta.c \
47          exp.c \
48          fma.c \
49          fr_div.c \
50          fr_sub.c \
51          get_prec2.c \
52          get_prec.c \
53          get_version.c \
54          get_x.c \
55          imag.c \
56          init2.c \
57          init3.c \
58          inp_str.c \
59          log.c \
60          log10.c \
61          mem.c \
62          mul_2si.c \
63          mul_2ui.c \
64          mul.c \
65          mul_fr.c \
66          mul_i.c \
67          mul_si.c \
68          mul_ui.c \
69          neg.c \
70          norm.c \
71          out_str.c \
72          pow.c \
73          pow_fr.c \
74          pow_ld.c \
75          pow_d.c \
76          pow_si.c \
77          pow_ui.c \
78          pow_z.c \
79          proj.c \
80          radius.c \
81          real.c \
82          rootofunity.c \
83          urandom.c \
84          set.c \
85          set_prec.c \
86          set_str.c \
87          set_x.c \
88          set_x_x.c \
89          sin.c \
90          sin_cos.c \
91          sinh.c \
92          sqr.c \
93          sqrt.c \
94          strtoc.c \
95          sub.c \
96          sub_fr.c \
97          sub_ui.c \
98          sum.c \
99          swap.c \
100          tan.c \
101          tanh.c \
102          uceil_log2.c \
103          ui_div.c \
104          ui_ui_sub.c
105
106CPPFLAGS+=          -I${.CURDIR}
107
108# Find <mpfr.h> and <gmp.h>
109.include "../../../gmp/Makefile.arch"
110CPPFLAGS+=          -I${NETBSDSRCDIR}/external/lgpl3/gmp/lib/libgmp/arch/${GMP_MACHINE_ARCH}
111CPPFLAGS+=          -I${NETBSDSRCDIR}/external/lgpl3/mpfr/dist/src
112
113# mostly mpc.h, MPC_RND_IM;
114# mpc_rnd_t is declared as int even though only 8 bits are actually used
115LINTFLAGS+=         -X 117              # bitwise '>>' on signed value possibly nonportable
116
117.include <bsd.lib.mk>
118
119.PATH: ${.CURDIR}/../../dist/src
120