xref: /csrg-svn/lib/libm/Makefile (revision 61280)
1*61280Sbostic#	@(#)Makefile	8.1 (Berkeley) 06/04/93
224585Szliu#
342234Sbostic# ieee		- for most IEEE machines, we hope.
442234Sbostic# mc68881	- the, ahem, mc68881.
542234Sbostic# national	- for those ieee machines whose floating point implementation
624585Szliu#		  has similar byte ordering as the NATIONAL 32016 with 32081.
745861Swilliam# i386		- i387 NPX, currently the same as "national"
852853Sralph# mips		- for MIPS achitecture machines
942234Sbostic# tahoe		- for the tahoe double format.
1042234Sbostic# vax		- for the vax D_floating format
1124585Szliu
1241620SbosticLIB=	m
1342234SbosticCFLAGS+=-I${.CURDIR}/common_source
1442234Sbostic
1542234Sbostic.if (${MACHINE} == "ieee")
1642234Sbostic
1741620SbosticHARDWARE=${MACHINE}
1842234Sbostic.PATH:	${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/ieee
1942234Sbostic# common_source
2052853SralphSRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
2156958Sbostic	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c \
2256958Sbostic	jn.c log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
2342234Sbostic# common
2442234SbosticSRCS+=	atan2.c sincos.c tan.c
2542234Sbostic# ieee
2642234SbosticSRCS+=	cabs.c cbrt.c support.c
2724585Szliu
2853882Smckusick.elif (${MACHINE} == "hp300" || ${MACHINE} == "luna68k")
2942234Sbostic
3042234SbosticHARDWARE=mc68881
3142234Sbostic.PATH:	${.CURDIR}/mc68881 ${.CURDIR}/common_source ${.CURDIR}/ieee
3242234Sbostic# common_source
3357890SbosticSRCS+=	acosh.c asinh.c erf.c exp.c exp__E.c fmod.c gamma.c lgamma.c \
3457890Sbostic	j0.c j1.c log.c log__L.c pow.c
3542234Sbostic# mc68881
3657879SbosticSRCS+=	asincos.s atan.s atan2.c atanh.s cosh.s expm1.s floor.s \
3757466Sbostic	log10.s log1p.s sincos.s sinh.s sqrt.s support.s tan.s tanh.s
3842234Sbostic# ieee
3942234SbosticSRCS+=	cabs.c cbrt.c
4042234Sbostic
4145861Swilliam.elif (${MACHINE} == "i386")
4245861Swilliam
4345861SwilliamHARDWARE=i387
4452853Sralph.PATH:	${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/ieee
4545861SwilliamCFLAGS+= -Dnational
4645861Swilliam# common_source
4752853SralphSRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
4857890Sbostic	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c \
4957890Sbostic	jn.c log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
5045861Swilliam# common
5145861SwilliamSRCS+=	atan2.c sincos.c tan.c
5245861Swilliam# ieee
5345861SwilliamSRCS+=	cabs.c cbrt.c support.c
5445861Swilliam
5552853Sralph.elif (${MACHINE} == "mips")
5652853Sralph
5752853SralphHARDWARE=${MACHINE}
5852853Sralph.PATH:	${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/ieee
5952853SralphCFLAGS+= -Dnational
6052853Sralph# common_source
6152853SralphSRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
6257890Sbostic	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c \
6357890Sbostic	jn.c log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
6452853Sralph# common
6552853SralphSRCS+=	atan2.c sincos.c tan.c
6652853Sralph# ieee
6752853SralphSRCS+=	cabs.c cbrt.c support.c
6852853Sralph
6942234Sbostic.elif (${MACHINE} == "national")
7042234Sbostic
7142234SbosticHARDWARE=${MACHINE}
7242234Sbostic.PATH:	${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/national \
7345861Swilliam.elif (${MACHINE} == "national")
7445861Swilliam
7545861SwilliamHARDWARE=${MACHINE}
7645861Swilliam.PATH:	${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/national \
7742234Sbostic	${.CURDIR}/ieee
7842234Sbostic# common_source
7952853SralphSRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
8057890Sbostic	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c \
8157890Sbostic	log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
8242234Sbostic# common
8342234SbosticSRCS+=	atan2.c sincos.c tan.c
8442234Sbostic# national
8542234SbosticSRCS+=	sqrt.s support.s
8642234Sbostic# ieee
8742234SbosticSRCS+=	cabs.c cbrt.c
8824585Szliu
8955777Sbostic.elif (${MACHINE} == "sparc")
9055777Sbostic
9155777SbosticHARDWARE=${MACHINE}
9255777Sbostic.PATH:  ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/ieee
9355777Sbostic# common_source
9455777SbosticSRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
9557880Storek	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c \
9657880Storek	jn.c log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
9755777Sbostic# XXX should do sqrt & support functions in assembly
9855777Sbostic# common
9955777SbosticSRCS+=	atan2.c sincos.c tan.c
10055777Sbostic# ieee
10155777SbosticSRCS+=	cabs.c cbrt.c support.c
10255777Sbostic
10342234Sbostic.elif (${MACHINE} == "tahoe")
10442234Sbostic
10542234SbosticHARDWARE=${MACHINE}
10642234Sbostic.PATH:	${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/tahoe \
10742234Sbostic# common_source
10852853SralphSRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
10957890Sbostic	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c \
11057890Sbostic	log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
11142234Sbostic# common
11242234SbosticSRCS+=	atan2.c sincos.c tan.c
11342234Sbostic# tahoe
11442234SbosticSRCS+=	cabs.s cbrt.s sqrt.s support.s infnan.s
11542234Sbostic
11642234Sbostic.elif (${MACHINE} == "vax")
11742234Sbostic
11842234SbosticHARDWARE=${MACHINE}
11942234Sbostic.PATH:	${.CURDIR}/common_source ${.CURDIR}/vax
12042234Sbostic# common_source
12152853SralphSRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
12257890Sbostic	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c \
12357890Sbostic	log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
12442234Sbostic# vax
12542234SbosticSRCS+=	atan2.s cabs.s cbrt.s sqrt.s sincos.s tan.s argred.s support.s \
12642234Sbostic	infnan.s
12742234Sbostic
12842234Sbostic.endif
12942234Sbostic
13048926ScaelMAN3+=	acos.0 acosh.0 asin.0 asinh.0 atan.0 atan2.0 atanh.0 ceil.0 \
13148926Scael	cos.0 cosh.0 erf.0 exp.0 fabs.0 floor.0 fmod.0 hypot.0 ieee.0 \
13248926Scael	infnan.0 j0.0 lgamma.0 math.0 rint.0 sin.0 sinh.0 sqrt.0 \
13348926Scael	tan.0 tanh.0
13424585Szliu
13541620SbosticMLINKS+=erf.3 erfc.3
13641620SbosticMLINKS+=exp.3 expm1.3 exp.3 log.3 exp.3 log10.3 exp.3 log1p.3 exp.3 pow.3
13741620SbosticMLINKS+=hypot.3 cabs.3
13841620SbosticMLINKS+=ieee.3 copysign.3 ieee.3 drem.3 ieee.3 finite.3 ieee.3 logb.3 \
13941620Sbostic	ieee.3 scalb.3
14041620SbosticMLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 yn.3
14141620SbosticMLINKS+=lgamma.3 gamma.3
14224585Szliu
14341620Sbostic# can't use the standard mkdep, because there are some .s files that
14441620Sbostic# are using '#' as a comment indicator and cpp thinks it's an undefined
14541620Sbostic# control.
14637823Sbostic
14743496Sbosticdepend: .depend
14843496Sbostic.depend: ${SRCS}
14941620Sbostic	mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
15031790Szliu
15141620Sbostic.include <bsd.lib.mk>
15224585Szliu
15341620Sbostic.s.o:
15441620Sbostic	${AS} -o ${.TARGET} ${.IMPSRC}
15541620Sbostic	@${LD} -x -r ${.TARGET}
15641620Sbostic	@mv a.out ${.TARGET}
15724585Szliu
15841620Sbostic.s.po:
15941620Sbostic	sed -f ${.CURDIR}/${HARDWARE}/mcount.sed ${.IMPSRC} | \
16041620Sbostic	    ${AS} -o ${.TARGET}
16141620Sbostic	@${LD} -X -r ${.TARGET}
16241620Sbostic	@mv a.out ${.TARGET}
163