xref: /minix3/lib/libm/Makefile (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc#  $NetBSD: Makefile,v 1.170 2015/09/13 10:58:30 he Exp $
22fe8fb19SBen Gras#
32fe8fb19SBen Gras#  @(#)Makefile 5.1beta 93/09/24
42fe8fb19SBen Gras#
52fe8fb19SBen Gras#  ====================================================
62fe8fb19SBen Gras#  Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
72fe8fb19SBen Gras#
82fe8fb19SBen Gras#  Developed at SunPro, a Sun Microsystems, Inc. business.
92fe8fb19SBen Gras#  Permission to use, copy, modify, and distribute this
102fe8fb19SBen Gras#  software is freely granted, provided that this notice
112fe8fb19SBen Gras#  is preserved.
122fe8fb19SBen Gras#  ====================================================
132fe8fb19SBen Gras#
142fe8fb19SBen Gras#
15b7061124SArun Thomas
162fe8fb19SBen Gras#
172fe8fb19SBen Gras# There are two options in making libm at fdlibm compile time:
182fe8fb19SBen Gras# 	_IEEE_LIBM 	--- IEEE libm; smaller, and somewhat faster
192fe8fb19SBen Gras#	_MULTI_LIBM	--- Support multi-standard at runtime by
202fe8fb19SBen Gras#			    imposing wrapper functions defined in
212fe8fb19SBen Gras#			    fdlibm.h:
222fe8fb19SBen Gras#				_IEEE_MODE 	-- IEEE
232fe8fb19SBen Gras#				_XOPEN_MODE 	-- X/OPEN
242fe8fb19SBen Gras#				_POSIX_MODE 	-- POSIX/ANSI
252fe8fb19SBen Gras#				_SVID3_MODE 	-- SVID
262fe8fb19SBen Gras#
272fe8fb19SBen Gras# Here is how to set up CPPFLAGS to create the desired libm at
282fe8fb19SBen Gras# compile time:
292fe8fb19SBen Gras#
302fe8fb19SBen Gras# 	CPPFLAGS = -D_IEEE_LIBM		... IEEE libm (recommended)
312fe8fb19SBen Gras#	CPPFLAGS = -D_SVID3_MODE	... Multi-standard supported
322fe8fb19SBen Gras#					    libm with SVID as the
332fe8fb19SBen Gras#					    default standard
342fe8fb19SBen Gras#	CPPFLAGS = -D_XOPEN_MODE	... Multi-standard supported
352fe8fb19SBen Gras#					    libm with XOPEN as the
362fe8fb19SBen Gras#					    default standard
372fe8fb19SBen Gras#	CPPFLAGS = -D_POSIX_MODE	... Multi-standard supported
382fe8fb19SBen Gras#					    libm with POSIX as the
392fe8fb19SBen Gras#					    default standard
402fe8fb19SBen Gras#	CPPFLAGS = 			... Multi-standard supported
412fe8fb19SBen Gras#					    libm with IEEE as the
422fe8fb19SBen Gras#					    default standard
432fe8fb19SBen Gras#
442fe8fb19SBen Gras
452fe8fb19SBen GrasUSE_SHLIBDIR=	yes
462fe8fb19SBen Gras
472fe8fb19SBen Gras# require this for the value of I387_LIBM from mk.conf, if set.
482fe8fb19SBen Gras.include <bsd.own.mk>
492fe8fb19SBen Gras
50*0a6a1f1dSLionel SambucLIBC_MACHINE_ARCH?=	${MACHINE_ARCH}
51*0a6a1f1dSLionel SambucLIBC_MACHINE_CPU?=	${MACHINE_CPU}
52*0a6a1f1dSLionel Sambuc
53*0a6a1f1dSLionel Sambuc# compiler_rt uses typeof() and __extension__
54*0a6a1f1dSLionel SambucLINTFLAGS += -g
55*0a6a1f1dSLionel Sambuc
56*0a6a1f1dSLionel Sambuc.if (${LIBC_MACHINE_CPU} == "aarch64")
57*0a6a1f1dSLionel Sambuc.PATH: ${.CURDIR}/arch/aarch64
58*0a6a1f1dSLionel SambucARCH_SRCS = e_sqrt.S e_sqrtf.S s_fabsf.S
59*0a6a1f1dSLionel SambucARCH_SRCS+= s_fma.S s_fmaf.S s_fmax.S s_fmaxf.S s_fmin.S s_fminf.S
60*0a6a1f1dSLionel SambucCOPTS.e_sqrtl.c += -DHAVE_FENV_H
61*0a6a1f1dSLionel SambucCOMMON_SRCS+= fenv.c
62*0a6a1f1dSLionel SambucCOMMON_SRCS+= e_sqrtl.c
63*0a6a1f1dSLionel SambucCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
64*0a6a1f1dSLionel Sambuc.elif (${LIBC_MACHINE_ARCH} == "alpha")
652fe8fb19SBen Gras.PATH: ${.CURDIR}/arch/alpha
662fe8fb19SBen GrasARCH_SRCS = s_copysign.S s_copysignf.S lrint.S
67*0a6a1f1dSLionel SambucCOPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
68*0a6a1f1dSLionel Sambuc.elif (${LIBC_MACHINE_CPU} == "arm")
69*0a6a1f1dSLionel Sambuc.PATH.c: ${.CURDIR}/arch/arm
70*0a6a1f1dSLionel SambucCOMMON_SRCS+= fenv.c s_nexttowardf.c \
71*0a6a1f1dSLionel Sambuc	s_nearbyint.c s_rintl.c
7284d9c625SLionel SambucCOPTS.e_sqrtl.c += -DHAVE_FENV_H
73*0a6a1f1dSLionel SambucCOPTS.fenv.c+=	-mfpu=vfp
7484d9c625SLionel Sambuc.if (${MKSOFTFLOAT} == "no")
75*0a6a1f1dSLionel Sambuc.PATH.S: ${.CURDIR}/arch/arm
7684d9c625SLionel SambucARCH_SRCS = e_sqrt.S e_sqrtf.S lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
7784d9c625SLionel Sambuc.endif
78*0a6a1f1dSLionel Sambuc.elif (${LIBC_MACHINE_ARCH} == "hppa")
79*0a6a1f1dSLionel Sambuc.PATH.c: ${.CURDIR}/arch/hppa
80*0a6a1f1dSLionel SambucCOMMON_SRCS+= fenv.c s_nexttowardf.c \
81*0a6a1f1dSLionel Sambuc	s_nearbyint.c s_rintl.c
82*0a6a1f1dSLionel SambucCOPTS.e_sqrtl.c += -DHAVE_FENV_H
83*0a6a1f1dSLionel Sambuc.elif (${LIBC_MACHINE_ARCH} == "sparc")
8484d9c625SLionel Sambuc.PATH: ${.CURDIR}/arch/sparc
8584d9c625SLionel SambucCOMMON_SRCS+= fenv.c
8684d9c625SLionel SambucCOPTS.e_sqrtl.c += -DHAVE_FENV_H
8784d9c625SLionel SambucCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
88*0a6a1f1dSLionel Sambuc.elif (${LIBC_MACHINE_ARCH} == "sparc64")
8984d9c625SLionel Sambuc.PATH: ${.CURDIR}/arch/sparc64
9084d9c625SLionel SambucCOMMON_SRCS+= fenv.c s_nexttowardf.c \
9184d9c625SLionel Sambuc	s_nearbyint.c s_rintl.c
9284d9c625SLionel SambucCOPTS.e_sqrtl.c += -DHAVE_FENV_H
9384d9c625SLionel Sambuc.ifndef _COMPAT_M32_MK_
9484d9c625SLionel SambucCOMMON_SRCS+= s_nexttoward.c
9584d9c625SLionel Sambuc.endif
9684d9c625SLionel SambucCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
972fe8fb19SBen Gras.elif ((${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "x86_64"))
982fe8fb19SBen Gras
99*0a6a1f1dSLionel Sambuc# XXX consider making this LIBC_MACHINE_ARCH?
1002fe8fb19SBen Gras.if (${MACHINE_ARCH} == "x86_64")
1012fe8fb19SBen Gras.PATH: ${.CURDIR}/arch/x86_64
1022fe8fb19SBen Gras.endif
1032fe8fb19SBen Gras.PATH:	${.CURDIR}/arch/i387
1042fe8fb19SBen Gras
10584d9c625SLionel SambucCOMMON_SRCS+= fenv.c s_nexttoward.c s_nexttowardf.c \
10684d9c625SLionel Sambuc	s_nearbyint.c s_rintl.c
10784d9c625SLionel SambucCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
10884d9c625SLionel SambucCOPTS.e_sqrtl.c += -DHAVE_FENV_H
10984d9c625SLionel Sambuc
1102fe8fb19SBen GrasARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_expf.S e_fmod.S e_log.S \
1112fe8fb19SBen Gras	    e_logf.S e_log10.S e_log10f.S e_log2.S e_log2f.S e_remainder.S \
1122fe8fb19SBen Gras	    e_remainderf.S e_scalb.S e_scalbf.S e_sqrt.S e_sqrtf.S s_atan.S \
1132fe8fb19SBen Gras	    s_atanf.S s_ceil.S s_ceilf.S s_copysign.S s_copysignf.S s_cos.S \
11484d9c625SLionel Sambuc	    s_cosf.S s_finite.S s_finitef.S s_floor.S s_floorf.S \
11584d9c625SLionel Sambuc	    s_ilogb.S s_ilogbf.S s_ilogbl.S s_log1p.S s_log1pf.S \
11684d9c625SLionel Sambuc	    s_logb.S s_logbf.S s_logbl.S \
11784d9c625SLionel Sambuc	    s_rint.S s_rintf.S s_scalbn.S s_scalbnf.S s_significand.S \
1182fe8fb19SBen Gras	    s_significandf.S s_sin.S s_sinf.S s_tan.S s_tanf.S lrint.S
1192fe8fb19SBen Gras# do not pick up the i387 asm version, it is incorrect
1202fe8fb19SBen Grass_modf.o s_modf.pico s_modf.po s_modf.d: s_modf.c
1212fe8fb19SBen Gras
1222fe8fb19SBen Gras.if (${MACHINE_ARCH} == "i386")
1232fe8fb19SBen GrasSUBDIR=arch/i387
1242fe8fb19SBen Gras.endif
125*0a6a1f1dSLionel Sambuc.elif (${LIBC_MACHINE_ARCH} == "m68k")
1262fe8fb19SBen Gras.if defined(M68060)
1272fe8fb19SBen Gras.PATH:	${.CURDIR}/arch/m68060
1282fe8fb19SBen Gras.include "${.CURDIR}/arch/m68060/Makefile.list"
1292fe8fb19SBen GrasCOPTS+=-m68060
1302fe8fb19SBen Gras.PATH:	${.CURDIR}/arch/m68k
1312fe8fb19SBen GrasARCH_SRCS += s_ceil.S s_copysign.S s_finite.S s_floor.S s_rint.S
1322fe8fb19SBen Gras.elif defined(M68040)
1332fe8fb19SBen Gras.PATH: ${.CURDIR}/arch/m68k
1342fe8fb19SBen GrasCOPTS+=-m68040
1352fe8fb19SBen GrasARCH_SRCS = s_copysign.S s_finite.S
1362fe8fb19SBen Gras.else
1372fe8fb19SBen Gras.if (${MKSOFTFLOAT} != "yes")
1382fe8fb19SBen Gras.PATH:	${.CURDIR}/arch/mc68881 ${.CURDIR}/arch/m68k
1392fe8fb19SBen GrasARCH_SRCS = e_acos.S e_asin.S e_atanh.S e_cosh.S e_exp.S e_fmod.S e_log.S \
1402fe8fb19SBen Gras	    e_log10.S e_remainder.S e_scalb.S e_sinh.S e_sqrt.S s_atan.S \
1412fe8fb19SBen Gras	    s_ceil.S s_copysign.S s_cos.S s_expm1.S s_finite.S s_floor.S \
1422fe8fb19SBen Gras	    s_log1p.S s_logb.S s_rint.S s_scalbn.S s_sin.S s_tan.S s_tanh.S
1432fe8fb19SBen Gras.endif
1442fe8fb19SBen Gras.endif
1452fe8fb19SBen Gras# end of m68k
146*0a6a1f1dSLionel Sambuc.elif (${LIBC_MACHINE_ARCH} == "vax")
14784d9c625SLionel Sambuc.PATH:	${.CURDIR}/arch/vax
1482fe8fb19SBen Gras
149*0a6a1f1dSLionel Sambuc#NOIEEE_ARCH+= s_fmax.c s_fmaxf.c s_fmaxl.c
150*0a6a1f1dSLionel Sambuc#NOIEEE_ARCH+= n_infnan.S n_argred.S n_sqrt.S
1512fe8fb19SBen Gras#ARCH_SRCS = n_atan2.S n_cabs.S n_cbrt.S n_support.S n_sincos.S n_tan.S
1522fe8fb19SBen Gras# XXX - ripped out due to lack of the insn polyd in the Mariah chip,
1532fe8fb19SBen Gras# and emulation code isn't written yet.
15484d9c625SLionel SambucARCH_SRCS = n_scalbn.S
15584d9c625SLionel SambucWARNS?=5
156*0a6a1f1dSLionel Sambuc.elif (${LIBC_MACHINE_CPU} == "riscv")
157*0a6a1f1dSLionel Sambuc.PATH:	${.CURDIR}/arch/riscv
158*0a6a1f1dSLionel Sambuc
159*0a6a1f1dSLionel SambucCOMMON_SRCS += fenv.c
160*0a6a1f1dSLionel Sambuc
161*0a6a1f1dSLionel Sambuc.if ${MKSOFTFLOAT} == "no"
162*0a6a1f1dSLionel SambucARCH_SRCS = e_sqrt.S e_sqrtf.S
163*0a6a1f1dSLionel SambucARCH_SRCS += s_copysign.S s_copysignf.S
164*0a6a1f1dSLionel SambucARCH_SRCS += s_fabs.S s_fabsf.S
165*0a6a1f1dSLionel SambucARCH_SRCS += s_fma.S s_fmaf.S
166*0a6a1f1dSLionel SambucARCH_SRCS += s_fmax.S s_fmaxf.S
167*0a6a1f1dSLionel SambucARCH_SRCS += s_fmin.S s_fminf.S
168*0a6a1f1dSLionel Sambuc.endif
1692fe8fb19SBen Gras.endif
1702fe8fb19SBen Gras
17184d9c625SLionel SambucWARNS?=5
1722fe8fb19SBen Gras
1732fe8fb19SBen Gras.PATH:	${.CURDIR}/man
1742fe8fb19SBen Gras.PATH:	${.CURDIR}/src
1752fe8fb19SBen Gras.PATH:	${.CURDIR}/noieee_src
1762fe8fb19SBen Gras
177*0a6a1f1dSLionel Sambuc.if (${LIBC_MACHINE_ARCH} == "alpha")
17884d9c625SLionel SambucCOPTS+= -mfp-rounding-mode=d
17984d9c625SLionel Sambuc.endif
18084d9c625SLionel Sambuc
181*0a6a1f1dSLionel Sambuc.if (${LIBC_MACHINE_ARCH} != "vax")
1822fe8fb19SBen GrasCPPFLAGS+= -D_MULTI_LIBM -D_POSIX_MODE
1832fe8fb19SBen Gras# XXX noieee libm is gross
1842fe8fb19SBen GrasCOPTS+=	-fno-strict-aliasing
1852fe8fb19SBen Gras.endif
1862fe8fb19SBen GrasCPPFLAGS+=-DLIBM_SCCS
187b7061124SArun Thomas
188b7061124SArun ThomasLIB=	m
18984d9c625SLionel SambucCOMMON_SRCS+= b_exp.c b_log.c b_tgamma.c \
19084d9c625SLionel Sambuc	e_acos.c e_acosf.c e_acosh.c e_acoshf.c e_asin.c e_asinf.c \
1912fe8fb19SBen Gras	e_atan2.c e_atan2f.c e_atanh.c e_atanhf.c e_cosh.c e_coshf.c e_exp.c \
19284d9c625SLionel Sambuc	e_expf.c e_fmod.c e_fmodf.c e_fmodl.c e_hypot.c e_hypotf.c \
19384d9c625SLionel Sambuc	e_j0.c e_j0f.c \
1942fe8fb19SBen Gras	e_j1.c e_j1f.c e_jn.c e_jnf.c e_lgamma_r.c e_lgammaf_r.c e_log.c \
1952fe8fb19SBen Gras	e_log2.c e_log10.c e_log10f.c e_log2f.c e_logf.c e_pow.c e_powf.c \
1962fe8fb19SBen Gras	e_rem_pio2.c e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c \
19784d9c625SLionel Sambuc	e_scalbf.c e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c e_sqrtl.c \
1982fe8fb19SBen Gras	k_cos.c k_cosf.c k_rem_pio2.c k_rem_pio2f.c k_sin.c k_sinf.c \
1992fe8fb19SBen Gras	k_standard.c k_tan.c k_tanf.c \
20084d9c625SLionel Sambuc	ldbl_dummy.c \
20184d9c625SLionel Sambuc	s_asinh.c s_asinhf.c s_atan.c s_atanf.c s_cbrt.c s_cbrtf.c s_cbrtl.c \
20284d9c625SLionel Sambuc	s_ceil.c s_ceilf.c s_ceill.c s_copysign.c s_copysignf.c s_copysignl.c \
20384d9c625SLionel Sambuc	s_cos.c s_cosf.c s_erf.c \
2042fe8fb19SBen Gras	s_erff.c s_exp2.c s_exp2f.c s_expm1.c s_expm1f.c s_fabsf.c s_fabsl.c \
2052fe8fb19SBen Gras	s_finite.c s_finitef.c \
20684d9c625SLionel Sambuc	s_floor.c s_floorf.c s_floorl.c s_frexpf.c \
20784d9c625SLionel Sambuc	s_ilogb.c s_ilogbf.c s_ilogbl.c \
20884d9c625SLionel Sambuc	s_isinff.c s_isnanf.c s_lib_version.c s_log1p.c \
20984d9c625SLionel Sambuc	s_log1pf.c s_logb.c s_logbf.c s_logbl.c \
210*0a6a1f1dSLionel Sambuc	s_matherr.c s_modff.c s_modfl.c s_nextafter.c s_nextafterl.c \
21184d9c625SLionel Sambuc	s_nextafterf.c s_remquo.c s_remquof.c s_rint.c s_rintf.c \
21284d9c625SLionel Sambuc	s_round.c s_roundf.c s_roundl.c s_scalbn.c \
21384d9c625SLionel Sambuc	s_scalbnf.c s_scalbnl.c s_signgam.c s_significand.c s_significandf.c s_sin.c \
21484d9c625SLionel Sambuc	s_sinf.c s_tan.c s_tanf.c s_tanh.c s_tanhf.c s_tgammaf.c \
21584d9c625SLionel Sambuc	s_trunc.c s_truncf.c s_truncl.c \
2162fe8fb19SBen Gras	w_acos.c w_acosf.c w_acosh.c w_acoshf.c w_asin.c w_asinf.c w_atan2.c \
2172fe8fb19SBen Gras	w_atan2f.c w_atanh.c w_atanhf.c w_cosh.c w_coshf.c \
21884d9c625SLionel Sambuc	w_drem.c w_dremf.c w_exp.c w_expf.c w_fmod.c w_fmodf.c w_fmodl.c \
21984d9c625SLionel Sambuc	w_gamma.c w_gamma_r.c w_gammaf.c w_gammaf_r.c w_hypot.c w_hypotf.c \
22084d9c625SLionel Sambuc	w_j0.c \
2212fe8fb19SBen Gras	w_j0f.c w_j1.c w_j1f.c w_jn.c w_jnf.c w_lgamma.c w_lgamma_r.c \
2222fe8fb19SBen Gras	w_lgammaf.c w_lgammaf_r.c w_log.c w_log10.c w_log10f.c w_log2.c \
2232fe8fb19SBen Gras	w_log2f.c w_logf.c \
2242fe8fb19SBen Gras	w_pow.c w_powf.c w_remainder.c w_remainderf.c w_scalb.c w_scalbf.c \
22584d9c625SLionel Sambuc	w_sinh.c w_sinhf.c w_sqrt.c w_sqrtf.c w_sqrtl.c \
2262fe8fb19SBen Gras	lrint.c lrintf.c llrint.c llrintf.c lround.c lroundf.c llround.c \
22784d9c625SLionel Sambuc	llroundf.c s_frexp.c s_frexpl.c s_modf.c \
22884d9c625SLionel Sambuc	s_fmax.c s_fmaxf.c s_fmaxl.c \
22984d9c625SLionel Sambuc	s_fmin.c s_fminf.c s_fminl.c s_fdim.c
230b7061124SArun Thomas
2312fe8fb19SBen Gras.PATH:	${.CURDIR}/compat
2322fe8fb19SBen GrasCOMMON_SRCS+= compat_cabs.c compat_cabsf.c
2332fe8fb19SBen Gras# XXX our compatibility cabs() is different!
23484d9c625SLionel SambucCOPTS.compat_cabs.c=	${${ACTIVE_CC} == "gcc":? -fno-builtin-cabs :}
23584d9c625SLionel SambucCOPTS.compat_cabsf.c=	${${ACTIVE_CC} == "gcc":? -fno-builtin-cabsf :}
236b7061124SArun Thomas
2372fe8fb19SBen Gras# math routines for non-IEEE architectures.
2382fe8fb19SBen GrasNOIEEE_SRCS = n_asincos.c n_acosh.c n_asinh.c n_atan.c n_atanh.c n_cosh.c \
239*0a6a1f1dSLionel Sambuc	n_erf.c n_exp.c n_exp2.c n_exp2f.c n_exp__E.c n_expm1.c n_floor.c \
240*0a6a1f1dSLionel Sambuc	n_fmod.c n_gamma.c \
2412fe8fb19SBen Gras	n_lgamma.c n_j0.c n_j1.c n_jn.c n_log.c n_log10.c n_log1p.c \
242*0a6a1f1dSLionel Sambuc	n_log2.c n_log__L.c n_pow.c n_sinh.c n_tanh.c \
2432fe8fb19SBen Gras	n_sincos.c n_tan.c \
2442fe8fb19SBen Gras	n_round.c n_roundf.c n_lround.c n_lroundf.c \
2452fe8fb19SBen Gras	n_fmax.c n_fmaxf.c n_fmin.c n_fminf.c
2462fe8fb19SBen Gras#	n_sqrt.c n_argred.c n_infnan.c n_atan2.c n_cabs.c n_cbrt.c n_support.c
2472fe8fb19SBen Gras
2482fe8fb19SBen Gras
2492fe8fb19SBen Gras# NetBSD's C library supplies these functions:
2502fe8fb19SBen Gras#COMMON_SRCS+=	s_fabs.c s_frexp.c s_isinf.c s_isnan.c s_ldexp.c s_modf.c
2512fe8fb19SBen Gras
252*0a6a1f1dSLionel Sambuc.if (${LIBC_MACHINE_ARCH} == "vax")
2532fe8fb19SBen GrasSRCS=	${NOIEEE_SRCS} ${NOIEEE_ARCH}
2542fe8fb19SBen Gras.else
2552fe8fb19SBen GrasSRCS=	${COMMON_SRCS}
2562fe8fb19SBen Gras.endif
2572fe8fb19SBen Gras
2582fe8fb19SBen Gras.ifdef ARCH_ADDS
2592fe8fb19SBen GrasSRCS+= ${ARCH_ADDS}
2602fe8fb19SBen Gras.endif
2612fe8fb19SBen Gras
2622fe8fb19SBen Gras# Substitute common sources with any arch specific sources
2632fe8fb19SBen Gras.for i in ${ARCH_SRCS} ${NOIEEE_ARCH}
2642fe8fb19SBen Gras    SRCS:=${SRCS:S/^${i:S/.S/.c/}/$i/}
2652fe8fb19SBen Gras.endfor
2662fe8fb19SBen Gras
267*0a6a1f1dSLionel Sambuc.if (${LIBC_MACHINE_ARCH} == "vax") # XXX until POLYD is written.
2682fe8fb19SBen Gras.PATH:	${.CURDIR}/arch/vax
2692fe8fb19SBen GrasSRCS:=${SRCS} n_sqrt.S n_argred.S n_infnan.S n_atan2.S n_cabs.S n_cbrt.S \
27084d9c625SLionel Sambuc	n_support.S n_scalbn.S
2712fe8fb19SBen Gras.endif
2722fe8fb19SBen Gras
273*0a6a1f1dSLionel Sambuc.if (${LIBC_MACHINE_ARCH} == "i386")
2742fe8fb19SBen Gras# XXX this gets miscompiled. There should be a better fix.
2752fe8fb19SBen GrasCOPTS.s_tanh.c+= -O0
2762fe8fb19SBen Gras.endif
2772fe8fb19SBen Gras
27884d9c625SLionel SambucMAN+=	acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \
27984d9c625SLionel Sambuc	ceil.3 copysign.3 cos.3 cosh.3 \
28084d9c625SLionel Sambuc	erf.3 exp.3 \
28184d9c625SLionel Sambuc	fabs.3 finite.3 fmod.3 frexp.3 hypot.3 \
28284d9c625SLionel Sambuc	ieee_test.3 ilogb.3 isinff.3 j0.3 ldexp.3 lgamma.3 log.3 lrint.3 \
28384d9c625SLionel Sambuc	math.3 modf.3 nextafter.3 pow.3 \
28484d9c625SLionel Sambuc	remainder.3 rint.3 round.3 \
28584d9c625SLionel Sambuc	scalbn.3 sin.3 sinh.3 sqrt.3 \
28684d9c625SLionel Sambuc	tan.3 tanh.3 trunc.3 fmax.3 fdim.3
2872fe8fb19SBen Gras
2882fe8fb19SBen Gras# fenv.h interface
2892fe8fb19SBen GrasMAN+=	feclearexcept.3 feenableexcept.3 fegetenv.3 fegetround.3 fenv.3
2902fe8fb19SBen GrasMLINKS+=feclearexcept.3 fegetexceptflag.3	\
2912fe8fb19SBen Gras	feclearexcept.3 feraiseexcept.3		\
2922fe8fb19SBen Gras	feclearexcept.3 fesetexceptflag.3	\
2932fe8fb19SBen Gras	feclearexcept.3 fetestexcept.3
2942fe8fb19SBen GrasMLINKS+=feenableexcept.3 fedisableexcept.3	\
2952fe8fb19SBen Gras	feenableexcept.3 fegetexcept.3
2962fe8fb19SBen GrasMLINKS+=fegetenv.3 feholdexcept.3		\
2972fe8fb19SBen Gras	fegetenv.3 fesetenv.3			\
2982fe8fb19SBen Gras	fegetenv.3 feupdateenv.3
2992fe8fb19SBen GrasMLINKS+=fegetround.3 fesetround.3
3002fe8fb19SBen Gras
3012fe8fb19SBen GrasMLINKS+=acos.3 acosf.3
3022fe8fb19SBen GrasMLINKS+=acosh.3 acoshf.3
3032fe8fb19SBen GrasMLINKS+=asin.3 asinf.3
3042fe8fb19SBen GrasMLINKS+=asinh.3 asinhf.3
3052fe8fb19SBen GrasMLINKS+=atan.3 atanf.3
3062fe8fb19SBen GrasMLINKS+=atan2.3 atan2f.3
3072fe8fb19SBen GrasMLINKS+=atanh.3 atanhf.3
30884d9c625SLionel SambucMLINKS+=ceil.3 ceilf.3 \
30984d9c625SLionel Sambuc	ceil.3 ceill.3 \
31084d9c625SLionel Sambuc	ceil.3 floor.3 \
31184d9c625SLionel Sambuc	ceil.3 floorf.3 \
31284d9c625SLionel Sambuc	ceil.3 floorl.3
31384d9c625SLionel SambucMLINKS+=copysign.3 copysignf.3 \
31484d9c625SLionel Sambuc	copysign.3 copysignl.3
3152fe8fb19SBen GrasMLINKS+=cos.3 cosf.3
3162fe8fb19SBen GrasMLINKS+=cosh.3 coshf.3
317*0a6a1f1dSLionel SambucMLINKS+=erf.3 erff.3 \
318*0a6a1f1dSLionel Sambuc	erf.3 erfl.3 \
319*0a6a1f1dSLionel Sambuc	erf.3 erfc.3 \
320*0a6a1f1dSLionel Sambuc	erf.3 erfcf.3 \
321*0a6a1f1dSLionel Sambuc	erf.3 erfcl.3
3222fe8fb19SBen GrasMLINKS+=exp.3 expf.3 exp.3 expm1.3 exp.3 expm1f.3 			\
32384d9c625SLionel Sambuc	exp.3 exp2.3 exp.3 exp2f.3
32484d9c625SLionel SambucMLINKS+=log.3 logf.3 \
32584d9c625SLionel Sambuc	log.3 log10.3 \
32684d9c625SLionel Sambuc	log.3 log10f.3 \
32784d9c625SLionel Sambuc	log.3 log1p.3 \
32884d9c625SLionel Sambuc	log.3 log1pf.3 \
32984d9c625SLionel Sambuc	log.3 log2.3 \
33084d9c625SLionel Sambuc	log.3 log2f.3
33184d9c625SLionel SambucMLINKS+=pow.3 powf.3
3322fe8fb19SBen GrasMLINKS+=fabs.3 fabsf.3
33384d9c625SLionel SambucMLINKS+=finite.3 finitef.3
33484d9c625SLionel SambucMLINKS+=fmod.3 fmodf.3 \
33584d9c625SLionel Sambuc	fmod.3 fmodl.3
3362fe8fb19SBen GrasMLINKS+=hypot.3 hypotf.3
33784d9c625SLionel SambucMLINKS+=ieee_test.3 logb.3 ieee_test.3 logbf.3 ieee_test.3 logbl.3
3382fe8fb19SBen GrasMLINKS+=ieee_test.3 scalb.3 ieee_test.3 scalbf.3
3392fe8fb19SBen GrasMLINKS+=ieee_test.3 significand.3 ieee_test.3 significandf.3
34084d9c625SLionel SambucMLINKS+=ilogb.3 ilogbf.3 ilogb.3 ilogbl.3
3412fe8fb19SBen GrasMLINKS+=isinff.3 isnanf.3
3422fe8fb19SBen GrasMLINKS+=j0.3 j0f.3 j0.3 j1.3 j0.3 j1f.3 j0.3 jn.3 j0.3 jnf.3 \
3432fe8fb19SBen Gras	j0.3 y0.3 j0.3 y0f.3 j0.3 y1.3 j0.3 y1f.3 j0.3 yn.3 j0.3 ynf.3
3442fe8fb19SBen GrasMLINKS+=lgamma.3 lgammaf.3 lgamma.3 lgamma_r.3 lgamma.3 lgammaf_r.3 \
3452fe8fb19SBen Gras	lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 gamma_r.3 \
34684d9c625SLionel Sambuc	lgamma.3 gammaf_r.3 lgamma.3 tgamma.3 lgamma.3 tgammaf.3
347*0a6a1f1dSLionel SambucMLINKS+=modf.3 modff.3 \
348*0a6a1f1dSLionel Sambuc	modf.3 modfl.3
34984d9c625SLionel SambucMLINKS+=nextafter.3 nextafterf.3 \
35084d9c625SLionel Sambuc	nextafter.3 nextafterl.3 \
351*0a6a1f1dSLionel Sambuc	nextafter.3 nexttoward.3 \
352*0a6a1f1dSLionel Sambuc	nextafter.3 nexttowardf.3
3532fe8fb19SBen GrasMLINKS+=lrint.3 lrintf.3 lrint.3 llrint.3 lrint.3 llrintf.3
35484d9c625SLionel SambucMLINKS+=remainder.3 remainderf.3 \
35584d9c625SLionel Sambuc	remainder.3 remquo.3 \
35684d9c625SLionel Sambuc	remainder.3 remquof.3
357*0a6a1f1dSLionel SambucMLINKS+=rint.3 rintf.3 \
358*0a6a1f1dSLionel Sambuc	rint.3 rintl.3 \
359*0a6a1f1dSLionel Sambuc	rint.3 nearbyint.3 \
360*0a6a1f1dSLionel Sambuc	rint.3 nearbyintf.3 \
361*0a6a1f1dSLionel Sambuc	rint.3 nearbyintl.3
36284d9c625SLionel SambucMLINKS+=scalbn.3 scalbnf.3 \
36384d9c625SLionel Sambuc	scalbn.3 scalbnl.3
3642fe8fb19SBen GrasMLINKS+=sin.3 sinf.3
36584d9c625SLionel SambucMLINKS+=sin.3 sinhf.3
36684d9c625SLionel SambucMLINKS+=sqrt.3 sqrtf.3 sqrt.3 sqrtl.3 \
36784d9c625SLionel Sambuc	sqrt.3 cbrt.3 sqrt.3 cbrtf.3 sqrt.3 cbrtl.3
3682fe8fb19SBen GrasMLINKS+=tan.3 tanf.3
3692fe8fb19SBen GrasMLINKS+=tanh.3 tanhf.3
37084d9c625SLionel SambucMLINKS+=round.3 roundf.3 \
37184d9c625SLionel Sambuc	round.3 roundl.3
37284d9c625SLionel SambucMLINKS+=trunc.3 truncf.3 \
37384d9c625SLionel Sambuc	trunc.3 truncl.3
3742fe8fb19SBen GrasMLINKS+=fmax.3 fmaxl.3
3752fe8fb19SBen GrasMLINKS+=fmax.3 fmaxf.3
3762fe8fb19SBen GrasMLINKS+=fmax.3 fmin.3
3772fe8fb19SBen GrasMLINKS+=fmax.3 fminl.3
3782fe8fb19SBen GrasMLINKS+=fmax.3 fminf.3
3792fe8fb19SBen GrasMLINKS+=fdim.3 fdiml.3
3802fe8fb19SBen GrasMLINKS+=fdim.3 fdimf.3
3812fe8fb19SBen Gras
3822fe8fb19SBen Gras.if (${MKCOMPLEX} != "no")
3832fe8fb19SBen Gras.include "${.CURDIR}/complex/Makefile.inc"
3842fe8fb19SBen Gras.endif
3852fe8fb19SBen Gras
38684d9c625SLionel SambucCOPTS.compat_cabs.c+=	${${ACTIVE_CC} == "clang":? -Wno-incompatible-library-redeclaration :}
38784d9c625SLionel SambucCOPTS.compat_cabsf.c+=	${${ACTIVE_CC} == "clang":? -Wno-incompatible-library-redeclaration :}
38884d9c625SLionel Sambuc
38984d9c625SLionel Sambuc.include "${.CURDIR}/compiler_rt/Makefile.inc"
3905ae1a533SBen Gras.include "${.CURDIR}/gen/Makefile.inc"
39184d9c625SLionel Sambuc
392c0c8d257SArun Thomas.include <bsd.lib.mk>
3932fe8fb19SBen Gras.include <bsd.subdir.mk>
394