Makefile revision 1.241
11.241Stsutsui#  $NetBSD: Makefile,v 1.241 2025/02/15 09:00:38 tsutsui Exp $
21.46Ssimonb#
31.46Ssimonb#  @(#)Makefile 5.1beta 93/09/24
41.27Sragge#
51.11Sjtc#  ====================================================
61.11Sjtc#  Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
71.46Ssimonb#
81.11Sjtc#  Developed at SunPro, a Sun Microsystems, Inc. business.
91.11Sjtc#  Permission to use, copy, modify, and distribute this
101.46Ssimonb#  software is freely granted, provided that this notice
111.11Sjtc#  is preserved.
121.11Sjtc#  ====================================================
131.46Ssimonb#
141.46Ssimonb#
151.11Sjtc
161.204SkamilNOSANITIZER=		# defined
171.204Skamil
181.11Sjtc#
191.11Sjtc# There are two options in making libm at fdlibm compile time:
201.11Sjtc# 	_IEEE_LIBM 	--- IEEE libm; smaller, and somewhat faster
211.46Ssimonb#	_MULTI_LIBM	--- Support multi-standard at runtime by
221.46Ssimonb#			    imposing wrapper functions defined in
231.11Sjtc#			    fdlibm.h:
241.11Sjtc#				_IEEE_MODE 	-- IEEE
251.11Sjtc#				_XOPEN_MODE 	-- X/OPEN
261.11Sjtc#				_POSIX_MODE 	-- POSIX/ANSI
271.11Sjtc#				_SVID3_MODE 	-- SVID
281.11Sjtc#
291.46Ssimonb# Here is how to set up CPPFLAGS to create the desired libm at
301.11Sjtc# compile time:
311.1Scgd#
321.37Slukem# 	CPPFLAGS = -D_IEEE_LIBM		... IEEE libm (recommended)
331.37Slukem#	CPPFLAGS = -D_SVID3_MODE	... Multi-standard supported
341.46Ssimonb#					    libm with SVID as the
351.11Sjtc#					    default standard
361.37Slukem#	CPPFLAGS = -D_XOPEN_MODE	... Multi-standard supported
371.46Ssimonb#					    libm with XOPEN as the
381.11Sjtc#					    default standard
391.37Slukem#	CPPFLAGS = -D_POSIX_MODE	... Multi-standard supported
401.46Ssimonb#					    libm with POSIX as the
411.11Sjtc#					    default standard
421.37Slukem#	CPPFLAGS = 			... Multi-standard supported
431.46Ssimonb#					    libm with IEEE as the
441.11Sjtc#					    default standard
451.46Ssimonb#
461.11Sjtc
471.84SchristosUSE_SHLIBDIR=	yes
481.55Stv
491.40Sperry# require this for the value of I387_LIBM from mk.conf, if set.
501.40Sperry.include <bsd.own.mk>
511.54Slukem
521.163SmattLIBC_MACHINE_ARCH?=	${MACHINE_ARCH}
531.163SmattLIBC_MACHINE_CPU?=	${MACHINE_CPU}
541.163Smatt
551.219SrilligLINTFLAGS+=	-g		# compiler_rt uses typeof() and __extension__
561.219SrilligLINTFLAGS+=	-X 117		# GCC sign-extends '>>' on signed int
571.227SrilligLINTFLAGS.s_logl.c+=	-X 161	# constant in conditional context
581.227SrilligLINTFLAGS.s_logl.c+=	-X 193	# unreachable statement (due to 161)
591.227SrilligLINTFLAGS.s_logl.c+=	-X 177	# non-constant initializer
601.156Schristos
611.236SriastradEXPSYM_SRCS=	m.common.expsym
621.236SriastradEXPSYM_SRCS+=	m.ieee754.expsym
631.236SriastradEXPSYM_SRCS+=	m.fenv.expsym
641.237SriastradEXPSYM_SRCS+=	${EXPSYM_SRC_MD:U}
651.237Sriastrad
661.236Sriastrad.if exists(${.CURDIR}/m.${LIBC_MACHINE_ARCH}.expsym)
671.237SriastradEXPSYM_SRC_MD=	m.${LIBC_MACHINE_ARCH}.expsym
681.236Sriastrad.elif exists(${.CURDIR}/m.${LIBC_MACHINE_CPU}.expsym)
691.237SriastradEXPSYM_SRC_MD=	m.${LIBC_MACHINE_CPU}.expsym
701.236Sriastrad.endif
711.236Sriastrad
721.236Sriastrad# We will build m.expsym with a rule below, by merging all the files
731.236Sriastrad# listed in EXPSYM_SRCS, which individual architectures can override.
741.236Sriastrad# (The rule has to be written below after EXPSYM_SRCS has been
751.236Sriastrad# determined.)
761.236SriastradLIB_EXPSYM=	m.expsym
771.236Sriastrad
781.239SmrgCOPTS+=	${${ACTIVE_CC} == "gcc":? -frounding-math :}
791.239Smrg
801.163Smatt.if (${LIBC_MACHINE_CPU} == "aarch64")
811.161Smatt.PATH: ${.CURDIR}/arch/aarch64
821.161SmattARCH_SRCS = e_sqrt.S e_sqrtf.S s_fabsf.S
831.161SmattARCH_SRCS+= s_fma.S s_fmaf.S s_fmax.S s_fmaxf.S s_fmin.S s_fminf.S
841.189Schs.if ${MKSOFTFLOAT} == "no"
851.161SmattCOMMON_SRCS+= fenv.c
861.189Schs.endif
871.202SchristosCOMMON_SRCS+= s_nexttoward.c s_rintl.c
881.161SmattCOMMON_SRCS+= e_sqrtl.c
891.161SmattCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
901.193She
911.163Smatt.elif (${LIBC_MACHINE_ARCH} == "alpha")
921.29Sjtc.PATH: ${.CURDIR}/arch/alpha
931.63SdrochnerARCH_SRCS = s_copysign.S s_copysignf.S lrint.S
941.196SheCOMMON_SRCS+= fenv.c
951.214StnnCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
961.159SmartinCOPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
971.192She
981.236Sriastrad# alpha doesn't have symbols for:
991.236Sriastrad#
1001.236Sriastrad#	feclearexcept
1011.236Sriastrad#	fegetexceptflag
1021.236Sriastrad#	fegetround
1031.236Sriastrad#	feraiseexcept
1041.236Sriastrad#	fesetexceptflag
1051.236Sriastrad#	fesetround
1061.236Sriastrad#	fetestexcept
1071.236Sriastrad#
1081.236Sriastrad# Instead, they are static inlines in fenv.h.  So we won't use
1091.236Sriastrad# m.fenv.expsym.
1101.236Sriastrad#
1111.236SriastradEXPSYM_SRCS=	m.common.expsym m.ieee754.expsym m.alpha.expsym
1121.236Sriastrad
1131.163Smatt.elif (${LIBC_MACHINE_CPU} == "arm")
1141.165Schristos.PATH.c: ${.CURDIR}/arch/arm
1151.189Schs.if ${MKSOFTFLOAT} == "no"
1161.189SchsCOMMON_SRCS+= fenv.c
1171.238SriastradEXPSYM_SRC_MD=	m.armhf.expsym
1181.189Schs.endif
1191.187Schristos.for f in fenv.c lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
1201.187SchristosCOPTS.$f +=	-mfpu=vfp
1211.187Schristos.endfor
1221.185SjakllschCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
1231.137Smatt.if (${MKSOFTFLOAT} == "no")
1241.165Schristos.PATH.S: ${.CURDIR}/arch/arm
1251.132SmattARCH_SRCS = e_sqrt.S e_sqrtf.S lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
1261.193She.endif
1271.192She
1281.188Sscole.elif (${LIBC_MACHINE_ARCH} == "ia64")
1291.188Sscole.PATH: ${.CURDIR}/arch/ia64
1301.196SheCOMMON_SRCS += fenv.c
1311.192She
1321.168Smartin.elif (${LIBC_MACHINE_ARCH} == "hppa")
1331.168Smartin.PATH.c: ${.CURDIR}/arch/hppa
1341.231SriastradCOMMON_SRCS+= fenv.c
1351.241StsutsuiCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
1361.192She
1371.163Smatt.elif (${LIBC_MACHINE_ARCH} == "sparc")
1381.110Snakayama.PATH: ${.CURDIR}/arch/sparc
1391.196SheCOMMON_SRCS+= fenv.c
1401.132SmattCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
1411.192She
1421.163Smatt.elif (${LIBC_MACHINE_ARCH} == "sparc64")
1431.102Schristos.PATH: ${.CURDIR}/arch/sparc64
1441.189SchsCOMMON_SRCS+= fenv.c
1451.200SheCOMMON_SRCS+= s_rintl.c
1461.141Smartin.ifndef _COMPAT_M32_MK_
1471.141SmartinCOMMON_SRCS+= s_nexttoward.c
1481.141Smartin.endif
1491.132SmattCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
1501.192She
1511.164Smrg.elif ((${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "x86_64"))
1521.95Sjoerg
1531.164Smrg# XXX consider making this LIBC_MACHINE_ARCH?
1541.164Smrg.if (${MACHINE_ARCH} == "x86_64")
1551.95Sjoerg.PATH: ${.CURDIR}/arch/x86_64
1561.95Sjoerg.endif
1571.40Sperry.PATH:	${.CURDIR}/arch/i387
1581.95Sjoerg
1591.200SheCOMMON_SRCS+= fenv.c s_nexttoward.c s_rintl.c
1601.132SmattCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
1611.130Schristos
1621.40SperryARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_expf.S e_fmod.S e_log.S \
1631.68Srpaulo	    e_logf.S e_log10.S e_log10f.S e_log2.S e_log2f.S e_remainder.S \
1641.68Srpaulo	    e_remainderf.S e_scalb.S e_scalbf.S e_sqrt.S e_sqrtf.S s_atan.S \
1651.205Sriastrad	    s_atanf.S s_ceil.S s_ceilf.S s_copysign.S s_copysignf.S \
1661.205Sriastrad	    s_finite.S s_finitef.S s_floor.S s_floorf.S \
1671.180Schristos	    s_log1p.S s_log1pf.S s_logb.S s_logbf.S s_logbl.S \
1681.228Sriastrad	    s_rint.S s_rintf.S s_rintl.S \
1691.228Sriastrad	    s_scalbn.S s_scalbnf.S \
1701.228Sriastrad	    s_significand.S s_significandf.S \
1711.228Sriastrad	    lrint.S
1721.180Schristos# do not pick up the i387 asm version for the following functions;
1731.180Schristos# it is incorrect
1741.205Sriastrad.for f in cos cosf modf ilogb ilogbl ilogbf sin sinf tan tanf
1751.184Schristoss_${f}.o s_${f}.pico s_${f}.po s_${f}.go s_${f}.d: s_${f}.c
1761.180Schristos.endfor
1771.95Sjoerg
1781.164Smrg.if (${MACHINE_ARCH} == "i386")
1791.52SchristosSUBDIR=arch/i387
1801.40Sperry.endif
1811.192She
1821.163Smatt.elif (${LIBC_MACHINE_ARCH} == "m68k")
1831.50Sis.if defined(M68060)
1841.50Sis.PATH:	${.CURDIR}/arch/m68060
1851.50Sis.include "${.CURDIR}/arch/m68060/Makefile.list"
1861.223SjklosCOPTS+= -m68060
1871.51Sis.PATH:	${.CURDIR}/arch/m68k
1881.51SisARCH_SRCS += s_ceil.S s_copysign.S s_finite.S s_floor.S s_rint.S
1891.50Sis.elif defined(M68040)
1901.51Sis.PATH: ${.CURDIR}/arch/m68k
1911.223SjklosCOPTS+= -m68040
1921.51SisARCH_SRCS = s_copysign.S s_finite.S
1931.223Sjklos.endif
1941.189Schs.if (${MKSOFTFLOAT} == "no")
1951.51Sis.PATH:	${.CURDIR}/arch/mc68881 ${.CURDIR}/arch/m68k
1961.30SjtcARCH_SRCS = e_acos.S e_asin.S e_atanh.S e_cosh.S e_exp.S e_fmod.S e_log.S \
1971.30Sjtc	    e_log10.S e_remainder.S e_scalb.S e_sinh.S e_sqrt.S s_atan.S \
1981.30Sjtc	    s_ceil.S s_copysign.S s_cos.S s_expm1.S s_finite.S s_floor.S \
1991.30Sjtc	    s_log1p.S s_logb.S s_rint.S s_scalbn.S s_sin.S s_tan.S s_tanh.S
2001.240SnatCOMMON_SRCS += fenv.c
2011.65Sjmmv.endif
2021.240SnatCOMMON_SRCS += s_nexttoward.c s_rintl.c
2031.221SrinCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
2041.50Sis# end of m68k
2051.192She
2061.163Smatt.elif (${LIBC_MACHINE_ARCH} == "vax")
2071.113Smatt.PATH:	${.CURDIR}/arch/vax
2081.71Sis
2091.169She#NOIEEE_ARCH+= s_fmax.c s_fmaxf.c s_fmaxl.c
2101.169She#NOIEEE_ARCH+= n_infnan.S n_argred.S n_sqrt.S
2111.41Sragge#ARCH_SRCS = n_atan2.S n_cabs.S n_cbrt.S n_support.S n_sincos.S n_tan.S
2121.41Sragge# XXX - ripped out due to lack of the insn polyd in the Mariah chip,
2131.41Sragge# and emulation code isn't written yet.
2141.138SmartinARCH_SRCS = n_scalbn.S
2151.122SmattWARNS?=5
2161.192She
2171.236Sriastrad# No IEEE 754 stuff.  Not all of it is actually specific to IEEE 754,
2181.236Sriastrad# but it's missing anyway: PR port-vax/57881.
2191.236SriastradEXPSYM_SRCS=	m.common.expsym m.vax.expsym
2201.236Sriastrad
2211.166Smatt.elif (${LIBC_MACHINE_CPU} == "riscv")
2221.166Smatt.PATH:	${.CURDIR}/arch/riscv
2231.166Smatt
2241.208SmrgCOMMON_SRCS+= s_nexttoward.c s_rintl.c
2251.207Smaya
2261.189Schs.if ${MKSOFTFLOAT} == "no"
2271.196SheCOMMON_SRCS += fenv.c
2281.166SmattARCH_SRCS = e_sqrt.S e_sqrtf.S
2291.166SmattARCH_SRCS += s_copysign.S s_copysignf.S
2301.166SmattARCH_SRCS += s_fabs.S s_fabsf.S
2311.166SmattARCH_SRCS += s_fma.S s_fmaf.S
2321.166SmattARCH_SRCS += s_fmax.S s_fmaxf.S
2331.166SmattARCH_SRCS += s_fmin.S s_fminf.S
2341.166Smatt.endif
2351.192She
2361.235Sriastrad.elif (${LIBC_MACHINE_CPU} == "powerpc")
2371.172Schristos.PATH:	${.CURDIR}/arch/powerpc
2381.189Schs.if ${MKSOFTFLOAT} == "no"
2391.196SheCOMMON_SRCS += fenv.c
2401.189Schs.endif
2411.215SheCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
2421.216SmartinARCH_SRCS += s_fma.S s_fmaf.S
2431.192She
2441.173Schristos.elif (${LIBC_MACHINE_CPU} == "mips")
2451.173Schristos.PATH:	${.CURDIR}/arch/mips
2461.189Schs.if ${MKSOFTFLOAT} == "no"
2471.196SheCOMMON_SRCS += fenv.c
2481.189Schs.endif
2491.213Schristos.if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
2501.202SchristosCOMMON_SRCS+= s_nexttoward.c
2511.230SriastradCOMMON_SRCS+= s_rintl.c
2521.202Schristos.endif
2531.222SheCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
2541.192She
2551.233Sriastrad.  if ${MKSOFTFLOAT} == "no"
2561.233Sriastrad.    if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
2571.237SriastradEXPSYM_SRC_MD=	m.mips64hf.expsym
2581.233Sriastrad.    else
2591.237SriastradEXPSYM_SRC_MD=	m.mipshf.expsym
2601.233Sriastrad.    endif
2611.233Sriastrad.  else
2621.233Sriastrad.    if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
2631.237SriastradEXPSYM_SRC_MD=	m.mips64.expsym
2641.233Sriastrad.    else
2651.237SriastradEXPSYM_SRC_MD=	m.mips.expsym
2661.233Sriastrad.    endif
2671.233Sriastrad.  endif
2681.233Sriastrad
2691.181Schristos.elif (${LIBC_MACHINE_CPU} == "sh3")
2701.181Schristos.PATH:	${.CURDIR}/arch/sh3
2711.189Schs.if ${MKSOFTFLOAT} == "no"
2721.196SheCOMMON_SRCS += fenv.c
2731.11Sjtc.endif
2741.220SrinCOMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
2751.189Schs.endif
2761.193She# End of list of CPU tests
2771.59Smatt
2781.122SmattWARNS?=5
2791.1Scgd
2801.11Sjtc.PATH:	${.CURDIR}/man
2811.11Sjtc.PATH:	${.CURDIR}/src
2821.27Sragge.PATH:	${.CURDIR}/noieee_src
2831.1Scgd
2841.236Sriastradm.expsym: ${EXPSYM_SRCS}
2851.236Sriastrad	${_MKTARGET_CREATE}
2861.236Sriastrad	LC_ALL=C sort -m ${.ALLSRC} >${.TARGET}.tmp && \
2871.236Sriastrad	${MV} ${.TARGET}.tmp ${.TARGET}
2881.236SriastradCLEANFILES+=	m.expsym m.expsym.tmp
2891.236Sriastrad
2901.163Smatt.if (${LIBC_MACHINE_ARCH} == "alpha")
2911.125SmattCOPTS+= -mfp-rounding-mode=d
2921.121Snjoly.endif
2931.121Snjoly
2941.163Smatt.if (${LIBC_MACHINE_ARCH} != "vax")
2951.37SlukemCPPFLAGS+= -D_MULTI_LIBM -D_POSIX_MODE
2961.76Smrg# XXX noieee libm is gross
2971.76SmrgCOPTS+=	-fno-strict-aliasing
2981.27Sragge.endif
2991.37SlukemCPPFLAGS+=-DLIBM_SCCS
3001.3Smycroft
3011.190Schs.if (${MKSOFTFLOAT} != "no" || ${MACHINE_ARCH} == "m68000")
3021.189Schs.PATH:	${.CURDIR}/softfloat
3031.189Schs.include "${.CURDIR}/../libc/libcincludes.mk"
3041.189SchsCPPFLAGS+=	-I${ARCHDIR}/softfloat
3051.189SchsCOMMON_SRCS += \
3061.189Schs	feclearexcept.c \
3071.189Schs	fedisableexcept.c \
3081.189Schs	feenableexcept.c \
3091.189Schs	fegetenv.c \
3101.189Schs	fegetexcept.c \
3111.189Schs	fegetexceptflag.c \
3121.189Schs	fegetround.c \
3131.189Schs	feholdexcept.c \
3141.189Schs	feraiseexcept.c \
3151.189Schs	fesetenv.c \
3161.189Schs	fesetexceptflag.c \
3171.189Schs	fesetround.c \
3181.189Schs	fetestexcept.c \
3191.189Schs	feupdateenv.c
3201.189Schs.endif
3211.189Schs
3221.11SjtcLIB=	m
3231.224SchristosCOMMON_SRCS+= b_exp.c b_log.c \
3241.224Schristos	b_tgamma.c b_tgammal.c \
3251.224Schristos	e_acos.c e_acosf.c e_acosl.c \
3261.224Schristos	e_acosh.c e_acoshf.c e_acoshl.c \
3271.224Schristos	e_asin.c e_asinf.c e_asinl.c \
3281.224Schristos	e_atan2.c e_atan2f.c e_atan2l.c \
3291.224Schristos	e_atanh.c e_atanhf.c e_atanhl.c \
3301.224Schristos	e_cosh.c e_coshf.c e_coshl.c \
3311.224Schristos	e_exp.c  e_expf.c \
3321.224Schristos	e_fmod.c e_fmodf.c e_fmodl.c \
3331.224Schristos	e_hypot.c e_hypotf.c e_hypotl.c \
3341.146Sjoerg	e_j0.c e_j0f.c \
3351.224Schristos	e_j1.c e_j1f.c \
3361.224Schristos	e_jn.c e_jnf.c \
3371.224Schristos	e_lgammal.c \
3381.224Schristos	e_lgamma_r.c e_lgammaf_r.c e_lgammal_r.c e_log.c \
3391.224Schristos	e_log2.c e_log10.c e_log10f.c e_log2f.c e_logf.c \
3401.224Schristos	e_pow.c e_powf.c e_powl.c \
3411.224Schristos	e_rem_pio2.c e_rem_pio2f.c \
3421.224Schristos	e_remainder.c e_remainderf.c e_remainderl.c \
3431.224Schristos	e_scalb.c e_scalbf.c \
3441.224Schristos	e_sinh.c e_sinhf.c e_sinhl.c \
3451.224Schristos	e_sqrt.c e_sqrtf.c e_sqrtl.c \
3461.224Schristos	invtrig.c \
3471.224Schristos	k_cos.c k_cosf.c \
3481.224Schristos	k_rem_pio2.c k_rem_pio2f.c \
3491.224Schristos	k_sin.c k_sinf.c \
3501.22Sjtc	k_standard.c k_tan.c k_tanf.c \
3511.224Schristos	s_asinh.c s_asinhf.c s_asinhl.c \
3521.224Schristos	s_atan.c s_atanf.c s_atanl.c \
3531.224Schristos	s_cbrt.c s_cbrtf.c s_cbrtl.c \
3541.144Sjoerg	s_ceil.c s_ceilf.c s_ceill.c s_copysign.c s_copysignf.c s_copysignl.c \
3551.224Schristos	s_cos.c s_cosf.c s_cosl.c \
3561.224Schristos	s_cospi.c s_cospif.c s_cospil.c \
3571.224Schristos	s_erf.c s_erff.c s_erfl.c \
3581.224Schristos	s_exp2.c s_exp2f.c s_expl.c s_exp2l.c s_expm1.c s_expm1f.c \
3591.224Schristos	s_fabsf.c s_fabsl.c \
3601.92Schristos	s_finite.c s_finitef.c \
3611.144Sjoerg	s_floor.c s_floorf.c s_floorl.c s_frexpf.c \
3621.144Sjoerg	s_ilogb.c s_ilogbf.c s_ilogbl.c \
3631.135Sjoerg	s_isinff.c s_isnanf.c s_lib_version.c s_log1p.c \
3641.191Schristos	s_llrint.c s_llrintf.c s_llrintl.c \
3651.191Schristos	s_llround.c s_llroundf.c s_llroundl.c \
3661.191Schristos	s_lrint.c s_lrintf.c s_lrintl.c \
3671.191Schristos	s_lround.c s_lroundf.c s_lroundl.c \
3681.224Schristos	s_log1pf.c s_logb.c s_logbf.c s_logbl.c s_logl.c \
3691.224Schristos	s_matherr.c s_modff.c s_modfl.c \
3701.224Schristos	s_nearbyint.c s_nextafter.c s_nextafterl.c \
3711.224Schristos	s_nextafterf.c s_nexttowardf.c \
3721.224Schristos	s_remquo.c s_remquof.c s_remquol.c \
3731.224Schristos	s_rint.c s_rintf.c \
3741.144Sjoerg	s_round.c s_roundf.c s_roundl.c s_scalbn.c \
3751.217Schristos	s_scalbnf.c s_scalbnl.c s_signgam.c s_significand.c s_significandf.c \
3761.217Schristos	s_sincos.c s_sincosf.c s_sincosl.c s_sin.c \
3771.224Schristos	s_sinf.c s_sinl.c \
3781.224Schristos	s_sinpi.c s_sinpif.c s_sinpil.c \
3791.224Schristos	s_tan.c s_tanf.c s_tanl.c \
3801.224Schristos	s_tanh.c s_tanhf.c s_tanhl.c \
3811.224Schristos	s_tanpi.c s_tanpif.c s_tanpil.c \
3821.224Schristos	s_tgammaf.c \
3831.148Sjoerg	s_trunc.c s_truncf.c s_truncl.c \
3841.22Sjtc	w_acos.c w_acosf.c w_acosh.c w_acoshf.c w_asin.c w_asinf.c w_atan2.c \
3851.78Sdrochner	w_atan2f.c w_atanh.c w_atanhf.c w_cosh.c w_coshf.c \
3861.146Sjoerg	w_drem.c w_dremf.c w_exp.c w_expf.c w_fmod.c w_fmodf.c w_fmodl.c \
3871.146Sjoerg	w_gamma.c w_gamma_r.c w_gammaf.c w_gammaf_r.c w_hypot.c w_hypotf.c \
3881.146Sjoerg	w_j0.c \
3891.22Sjtc	w_j0f.c w_j1.c w_j1f.c w_jn.c w_jnf.c w_lgamma.c w_lgamma_r.c \
3901.67Schristos	w_lgammaf.c w_lgammaf_r.c w_log.c w_log10.c w_log10f.c w_log2.c \
3911.67Schristos	w_log2f.c w_logf.c \
3921.22Sjtc	w_pow.c w_powf.c w_remainder.c w_remainderf.c w_scalb.c w_scalbf.c \
3931.150Sjoerg	w_sinh.c w_sinhf.c w_sqrt.c w_sqrtf.c w_sqrtl.c \
3941.191Schristos	s_frexp.c s_frexpl.c s_modf.c \
3951.132Smatt	s_fmax.c s_fmaxf.c s_fmaxl.c \
3961.132Smatt	s_fmin.c s_fminf.c s_fminl.c s_fdim.c
3971.90Schristos
3981.78Sdrochner.PATH:	${.CURDIR}/compat
3991.78SdrochnerCOMMON_SRCS+= compat_cabs.c compat_cabsf.c
4001.78Sdrochner# XXX our compatibility cabs() is different!
4011.123SjoergCOPTS.compat_cabs.c=	${${ACTIVE_CC} == "gcc":? -fno-builtin-cabs :}
4021.123SjoergCOPTS.compat_cabsf.c=	${${ACTIVE_CC} == "gcc":? -fno-builtin-cabsf :}
4031.78Sdrochner
4041.27Sragge# math routines for non-IEEE architectures.
4051.186SchristosNOIEEE_SRCS = n_asincos.c n_acosh.c n_asinh.c n_atan.c n_atanh.c n_atanhf.c \
4061.186Schristos	n_cosh.c \
4071.234Sriastrad	n_erf.c n_exp.c n_exp2.c n_exp2f.c n_exp__E.c n_expm1.c \
4081.234Sriastrad	n_floor.c n_fmod.c n_frexpf.c n_frexpl.c \
4091.234Sriastrad	n_gamma.c n_ilogb.c \
4101.27Sragge	n_lgamma.c n_j0.c n_j1.c n_jn.c n_log.c n_log10.c n_log1p.c \
4111.155Smartin	n_log2.c n_log__L.c n_pow.c n_sinh.c n_tanh.c \
4121.218Schristos	n_sincos.c n_sincos1.c n_tan.c \
4131.100Sjakllsch	n_round.c n_roundf.c n_lround.c n_lroundf.c \
4141.100Sjakllsch	n_fmax.c n_fmaxf.c n_fmin.c n_fminf.c
4151.46Ssimonb#	n_sqrt.c n_argred.c n_infnan.c n_atan2.c n_cabs.c n_cbrt.c n_support.c
4161.36Smikel
4171.27Sragge
4181.13Sjtc# NetBSD's C library supplies these functions:
4191.23Sjtc#COMMON_SRCS+=	s_fabs.c s_frexp.c s_isinf.c s_isnan.c s_ldexp.c s_modf.c
4201.17Sjtc
4211.163Smatt.if (${LIBC_MACHINE_ARCH} == "vax")
4221.27SraggeSRCS=	${NOIEEE_SRCS} ${NOIEEE_ARCH}
4231.27Sragge.else
4241.103SchristosSRCS=	${COMMON_SRCS}
4251.50Sis.endif
4261.50Sis
4271.50Sis.ifdef ARCH_ADDS
4281.50SisSRCS+= ${ARCH_ADDS}
4291.27Sragge.endif
4301.17Sjtc
4311.46Ssimonb# Substitute common sources with any arch specific sources
4321.33Sragge.for i in ${ARCH_SRCS} ${NOIEEE_ARCH}
4331.62Sdrochner    SRCS:=${SRCS:S/^${i:S/.S/.c/}/$i/}
4341.17Sjtc.endfor
4351.17Sjtc
4361.163Smatt.if (${LIBC_MACHINE_ARCH} == "vax") # XXX until POLYD is written.
4371.43Smatt.PATH:	${.CURDIR}/arch/vax
4381.43SmattSRCS:=${SRCS} n_sqrt.S n_argred.S n_infnan.S n_atan2.S n_cabs.S n_cbrt.S \
4391.138Smartin	n_support.S n_scalbn.S
4401.41Sragge.endif
4411.1Scgd
4421.163Smatt.if (${LIBC_MACHINE_ARCH} == "i386")
4431.97Sdrochner# XXX this gets miscompiled. There should be a better fix.
4441.97SdrochnerCOPTS.s_tanh.c+= -O0
4451.97Sdrochner.endif
4461.97Sdrochner
4471.106SjruohoMAN+=	acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \
4481.106Sjruoho	ceil.3 copysign.3 cos.3 cosh.3 \
4491.106Sjruoho	erf.3 exp.3 \
4501.171Snros	fabs.3 finite.3 fma.3 fmod.3 frexp.3 hypot.3 \
4511.119Sjruoho	ieee_test.3 ilogb.3 isinff.3 j0.3 ldexp.3 lgamma.3 log.3 lrint.3 \
4521.120Sjruoho	math.3 modf.3 nextafter.3 pow.3 \
4531.106Sjruoho	remainder.3 rint.3 round.3 \
4541.217Schristos	scalbn.3 sincos.3 sin.3 sinh.3 sqrt.3 \
4551.106Sjruoho	tan.3 tanh.3 trunc.3 fmax.3 fdim.3
4561.1Scgd
4571.95Sjoerg# fenv.h interface
4581.95SjoergMAN+=	feclearexcept.3 feenableexcept.3 fegetenv.3 fegetround.3 fenv.3
4591.95SjoergMLINKS+=feclearexcept.3 fegetexceptflag.3	\
4601.95Sjoerg	feclearexcept.3 feraiseexcept.3		\
4611.96Swiz	feclearexcept.3 fesetexceptflag.3	\
4621.95Sjoerg	feclearexcept.3 fetestexcept.3
4631.95SjoergMLINKS+=feenableexcept.3 fedisableexcept.3	\
4641.95Sjoerg	feenableexcept.3 fegetexcept.3
4651.95SjoergMLINKS+=fegetenv.3 feholdexcept.3		\
4661.95Sjoerg	fegetenv.3 fesetenv.3			\
4671.95Sjoerg	fegetenv.3 feupdateenv.3
4681.95SjoergMLINKS+=fegetround.3 fesetround.3
4691.95Sjoerg
4701.47SkleinkMLINKS+=acos.3 acosf.3
4711.47SkleinkMLINKS+=acosh.3 acoshf.3
4721.47SkleinkMLINKS+=asin.3 asinf.3
4731.47SkleinkMLINKS+=asinh.3 asinhf.3
4741.47SkleinkMLINKS+=atan.3 atanf.3
4751.47SkleinkMLINKS+=atan2.3 atan2f.3
4761.47SkleinkMLINKS+=atanh.3 atanhf.3
4771.107SjruohoMLINKS+=ceil.3 ceilf.3 \
4781.145Sjoerg	ceil.3 ceill.3 \
4791.107Sjruoho	ceil.3 floor.3 \
4801.145Sjoerg	ceil.3 floorf.3 \
4811.145Sjoerg	ceil.3 floorl.3
4821.106SjruohoMLINKS+=copysign.3 copysignf.3 \
4831.106Sjruoho	copysign.3 copysignl.3
4841.47SkleinkMLINKS+=cos.3 cosf.3
4851.209SmayaMLINKS+=cos.3 cosl.3
4861.47SkleinkMLINKS+=cosh.3 coshf.3
4871.225SnrosMLINKS+=cosh.3 coshl.3
4881.167SchristosMLINKS+=erf.3 erff.3 \
4891.167Schristos	erf.3 erfl.3 \
4901.167Schristos	erf.3 erfc.3 \
4911.167Schristos	erf.3 erfcf.3 \
4921.167Schristos	erf.3 erfcl.3
4931.98SchristosMLINKS+=exp.3 expf.3 exp.3 expm1.3 exp.3 expm1f.3 			\
4941.225Snros	exp.3 exp2.3 exp.3 exp2f.3 exp.3 expl.3				\
4951.225Snros	exp.3 expm1l.3 exp.3 exp2l.3
4961.119SjruohoMLINKS+=log.3 logf.3 \
4971.225Snros	log.3 logl.3 \
4981.119Sjruoho	log.3 log10.3 \
4991.119Sjruoho	log.3 log10f.3 \
5001.225Snros	log.3 log10l.3 \
5011.119Sjruoho	log.3 log1p.3 \
5021.119Sjruoho	log.3 log1pf.3 \
5031.225Snros	log.3 log1pl.3 \
5041.119Sjruoho	log.3 log2.3 \
5051.225Snros	log.3 log2f.3 \
5061.225Snros	log.3 log2l.3
5071.120SjruohoMLINKS+=pow.3 powf.3
5081.225SnrosMLINKS+=pow.3 powl.3
5091.175SnrosMLINKS+=fabs.3 fabsf.3 \
5101.175Snros	fabs.3 fabsl.3
5111.118SjruohoMLINKS+=finite.3 finitef.3
5121.146SjoergMLINKS+=fmod.3 fmodf.3 \
5131.146Sjoerg	fmod.3 fmodl.3
5141.203SmayaMLINKS+=hypot.3 hypotf.3 \
5151.203Smaya	hypot.3 hypotl.3
5161.116SjoergMLINKS+=ieee_test.3 logb.3 ieee_test.3 logbf.3 ieee_test.3 logbl.3
5171.47SkleinkMLINKS+=ieee_test.3 scalb.3 ieee_test.3 scalbf.3
5181.47SkleinkMLINKS+=ieee_test.3 significand.3 ieee_test.3 significandf.3
5191.115SjoergMLINKS+=ilogb.3 ilogbf.3 ilogb.3 ilogbl.3
5201.49SkleinkMLINKS+=isinff.3 isnanf.3
5211.47SkleinkMLINKS+=j0.3 j0f.3 j0.3 j1.3 j0.3 j1f.3 j0.3 jn.3 j0.3 jnf.3 \
5221.47Skleink	j0.3 y0.3 j0.3 y0f.3 j0.3 y1.3 j0.3 y1f.3 j0.3 yn.3 j0.3 ynf.3
5231.176SnrosMLINKS+=ldexp.3 ldexpf.3 \
5241.176Snros	ldexp.3 ldexpl.3
5251.48SkleinkMLINKS+=lgamma.3 lgammaf.3 lgamma.3 lgamma_r.3 lgamma.3 lgammaf_r.3 \
5261.48Skleink	lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 gamma_r.3 \
5271.225Snros	lgamma.3 gammaf_r.3 lgamma.3 tgamma.3 lgamma.3 tgammaf.3 \
5281.225Snros	lgamma.3 lgammal.3 lgamma.3 lgammal_r.3 lgamma.3 tgammal.3
5291.160SjoergMLINKS+=modf.3 modff.3 \
5301.160Sjoerg	modf.3 modfl.3
5311.105SjruohoMLINKS+=nextafter.3 nextafterf.3 \
5321.105Sjruoho	nextafter.3 nextafterl.3 \
5331.170She	nextafter.3 nexttoward.3 \
5341.210Skamil	nextafter.3 nexttowardf.3 \
5351.210Skamil	nextafter.3 nexttowardl.3
5361.225SnrosMLINKS+=lrint.3 lrintf.3 lrint.3 lrintl.3 lrint.3 llrint.3 lrint.3 llrintf.3 lrint.3 llrintl.3
5371.106SjruohoMLINKS+=remainder.3 remainderf.3 \
5381.225Snros	remainder.3 remainderl.3 \
5391.106Sjruoho	remainder.3 remquo.3 \
5401.225Snros	remainder.3 remquof.3 \
5411.225Snros	remainder.3 remquol.3
5421.169SheMLINKS+=rint.3 rintf.3 \
5431.169She	rint.3 rintl.3 \
5441.169She	rint.3 nearbyint.3 \
5451.169She	rint.3 nearbyintf.3 \
5461.169She	rint.3 nearbyintl.3
5471.117SjruohoMLINKS+=scalbn.3 scalbnf.3 \
5481.117Sjruoho	scalbn.3 scalbnl.3
5491.225SnrosMLINKS+=sin.3 sinf.3 \
5501.225Snros	sin.3 sinl.3
5511.226SnrosMLINKS+=sinh.3 sinhf.3
5521.225SnrosMLINKS+=sinh.3 sinhl.3
5531.150SjoergMLINKS+=sqrt.3 sqrtf.3 sqrt.3 sqrtl.3 \
5541.150Sjoerg	sqrt.3 cbrt.3 sqrt.3 cbrtf.3 sqrt.3 cbrtl.3
5551.225SnrosMLINKS+=tan.3 tanf.3 \
5561.225Snros	tan.3 tanl.3
5571.225SnrosMLINKS+=tanh.3 tanhf.3 \
5581.225Snros	tanh.3 tanhl.3
5591.145SjoergMLINKS+=round.3 roundf.3 \
5601.145Sjoerg	round.3 roundl.3
5611.149SjoergMLINKS+=trunc.3 truncf.3 \
5621.149Sjoerg	trunc.3 truncl.3
5631.90SchristosMLINKS+=fmax.3 fmaxl.3
5641.90SchristosMLINKS+=fmax.3 fmaxf.3
5651.90SchristosMLINKS+=fmax.3 fmin.3
5661.90SchristosMLINKS+=fmax.3 fminl.3
5671.90SchristosMLINKS+=fmax.3 fminf.3
5681.90SchristosMLINKS+=fdim.3 fdiml.3
5691.90SchristosMLINKS+=fdim.3 fdimf.3
5701.171SnrosMLINKS+=fma.3 fmaf.3 \
5711.171Snros	fma.3 fmal.3
5721.211SnrosMLINKS+=frexp.3 frexpf.3 \
5731.211Snros	frexp.3 frexpl.3
5741.1Scgd
5751.89She.if (${MKCOMPLEX} != "no")
5761.82Sdrochner.include "${.CURDIR}/complex/Makefile.inc"
5771.87Sgmcgarry.endif
5781.87Sgmcgarry
5791.142SjoergCOPTS.compat_cabs.c+=	${${ACTIVE_CC} == "clang":? -Wno-incompatible-library-redeclaration :}
5801.142SjoergCOPTS.compat_cabsf.c+=	${${ACTIVE_CC} == "clang":? -Wno-incompatible-library-redeclaration :}
5811.212SjoergCWARNFLAGS.clang+=		-Wno-error=implicit-int-float-conversion
5821.142Sjoerg
5831.154Sjoerg.include "${.CURDIR}/compiler_rt/Makefile.inc"
5841.72Skleink.include "${.CURDIR}/gen/Makefile.inc"
5851.143Sjoerg
5861.1Scgd.include <bsd.lib.mk>
5871.52Schristos.include <bsd.subdir.mk>
588