don't use assembly log() for mc68881 (try #2)
[unix-history] / usr / src / lib / libm / Makefile
CommitLineData
d35304dc 1# @(#)Makefile 5.13 (Berkeley) %G%
e7e6d508 2#
76beb36b
KB
3# ieee - for most IEEE machines, we hope.
4# mc68881 - the, ahem, mc68881.
5# national - for those ieee machines whose floating point implementation
e7e6d508 6# has similar byte ordering as the NATIONAL 32016 with 32081.
a87254a0 7# i386 - i387 NPX, currently the same as "national"
297cf220 8# mips - for MIPS achitecture machines
76beb36b
KB
9# tahoe - for the tahoe double format.
10# vax - for the vax D_floating format
e7e6d508 11
2f644e4b
KB
12# Missing: erf.c, j0.c, j1.c, jn.c, lgamma.c
13
770d844a 14LIB= m
76beb36b
KB
15CFLAGS+=-I${.CURDIR}/common_source
16
17.if (${MACHINE} == "ieee")
18
19HARDWARE=${MACHINE}
20.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/ieee
21# common_source
afaa0088
KB
22 exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c \
23 jn.c log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
76beb36b
KB
24# common
25SRCS+= atan2.c sincos.c tan.c
26# ieee
27SRCS+= cabs.c cbrt.c support.c
28
7c02c1d3 29.elif (${MACHINE} == "hp300" || ${MACHINE} == "luna68k")
76beb36b
KB
30
31HARDWARE=mc68881
32.PATH: ${.CURDIR}/mc68881 ${.CURDIR}/common_source ${.CURDIR}/ieee
33# common_source
d35304dc
KB
34SRCS+= acosh.c asinh.c erf.c exp__E.c fmod.c lgamma.c j0.c j1.c log.c \
35 log__L.c pow.c
76beb36b
KB
36# mc68881
37SRCS+= asincos.s atan.s atan2.c atanh.s cosh.s exp.s expm1.s floor.s \
7df93100 38 log10.s log1p.s sincos.s sinh.s sqrt.s support.s tan.s tanh.s
76beb36b
KB
39# ieee
40SRCS+= cabs.c cbrt.c
41
a87254a0
WN
42.elif (${MACHINE} == "i386")
43
44HARDWARE=i387
297cf220
RC
45.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/ieee
46CFLAGS+= -Dnational
47# common_source
48SRCS+= acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
49 exp__E.c expm1.c floor.c fmod.c lgamma.c j0.c j1.c jn.c log.c \
50 log10.c log1p.c log__L.c pow.c sinh.c tanh.c
51# common
52SRCS+= atan2.c sincos.c tan.c
53# ieee
54SRCS+= cabs.c cbrt.c support.c
55
56.elif (${MACHINE} == "mips")
57
58HARDWARE=${MACHINE}
59.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/ieee
a87254a0
WN
60CFLAGS+= -Dnational
61# common_source
2f644e4b
KB
62SRCS+= acosh.c asincos.c asinh.c atan.c atanh.c cosh.c exp.c \
63 exp__E.c expm1.c floor.c fmod.c log.c \
a87254a0
WN
64 log10.c log1p.c log__L.c pow.c sinh.c tanh.c
65# common
66SRCS+= atan2.c sincos.c tan.c
67# ieee
68SRCS+= cabs.c cbrt.c support.c
69
70.elif (${MACHINE} == "national")
71
72HARDWARE=${MACHINE}
73.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/national \
76beb36b
KB
74.elif (${MACHINE} == "national")
75
770d844a 76HARDWARE=${MACHINE}
76beb36b
KB
77.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/national \
78 ${.CURDIR}/ieee
79# common_source
2f644e4b
KB
80SRCS+= acosh.c asincos.c asinh.c atan.c atanh.c cosh.c exp.c \
81 exp__E.c expm1.c floor.c fmod.c log.c \
76beb36b
KB
82 log10.c log1p.c log__L.c pow.c sinh.c tanh.c
83# common
84SRCS+= atan2.c sincos.c tan.c
85# national
86SRCS+= sqrt.s support.s
87# ieee
88SRCS+= cabs.c cbrt.c
e7e6d508 89
f183e89d
KB
90.elif (${MACHINE} == "sparc")
91
92HARDWARE=${MACHINE}
93.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/ieee
94# common_source
95SRCS+= acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
96 exp__E.c expm1.c floor.c fmod.c lgamma.c j0.c j1.c jn.c log.c \
97 log10.c log1p.c log__L.c pow.c sinh.c tanh.c
98# XXX should do sqrt & support functions in assembly
99# common
100SRCS+= atan2.c sincos.c tan.c
101# ieee
102SRCS+= cabs.c cbrt.c support.c
103
76beb36b
KB
104.elif (${MACHINE} == "tahoe")
105
106HARDWARE=${MACHINE}
107.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/tahoe \
108# common_source
2f644e4b
KB
109SRCS+= acosh.c asincos.c asinh.c atan.c atanh.c cosh.c exp.c \
110 exp__E.c expm1.c floor.c fmod.c log.c \
770d844a 111 log10.c log1p.c log__L.c pow.c sinh.c tanh.c
76beb36b
KB
112# common
113SRCS+= atan2.c sincos.c tan.c
114# tahoe
115SRCS+= cabs.s cbrt.s sqrt.s support.s infnan.s
116
117.elif (${MACHINE} == "vax")
118
119HARDWARE=${MACHINE}
120.PATH: ${.CURDIR}/common_source ${.CURDIR}/vax
121# common_source
2f644e4b
KB
122SRCS+= acosh.c asincos.c asinh.c atan.c atanh.c cosh.c exp.c \
123 exp__E.c expm1.c floor.c fmod.c log.c \
76beb36b
KB
124 log10.c log1p.c log__L.c pow.c sinh.c tanh.c
125# vax
126SRCS+= atan2.s cabs.s cbrt.s sqrt.s sincos.s tan.s argred.s support.s \
127 infnan.s
128
129.endif
e7e6d508 130
34a78eae
CL
131MAN3+= acos.0 acosh.0 asin.0 asinh.0 atan.0 atan2.0 atanh.0 ceil.0 \
132 cos.0 cosh.0 erf.0 exp.0 fabs.0 floor.0 fmod.0 hypot.0 ieee.0 \
133 infnan.0 j0.0 lgamma.0 math.0 rint.0 sin.0 sinh.0 sqrt.0 \
134 tan.0 tanh.0
e0085737 135
770d844a
KB
136MLINKS+=erf.3 erfc.3
137MLINKS+=exp.3 expm1.3 exp.3 log.3 exp.3 log10.3 exp.3 log1p.3 exp.3 pow.3
770d844a
KB
138MLINKS+=hypot.3 cabs.3
139MLINKS+=ieee.3 copysign.3 ieee.3 drem.3 ieee.3 finite.3 ieee.3 logb.3 \
140 ieee.3 scalb.3
141MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 yn.3
142MLINKS+=lgamma.3 gamma.3
e0085737 143
770d844a
KB
144# can't use the standard mkdep, because there are some .s files that
145# are using '#' as a comment indicator and cpp thinks it's an undefined
146# control.
a73667b8 147
a201c6cd
KB
148depend: .depend
149.depend: ${SRCS}
770d844a 150 mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
e7e6d508 151
770d844a 152.include <bsd.lib.mk>
a73667b8 153
770d844a
KB
154.s.o:
155 ${AS} -o ${.TARGET} ${.IMPSRC}
156 @${LD} -x -r ${.TARGET}
157 @mv a.out ${.TARGET}
e0085737 158
770d844a
KB
159.s.po:
160 sed -f ${.CURDIR}/${HARDWARE}/mcount.sed ${.IMPSRC} | \
161 ${AS} -o ${.TARGET}
162 @${LD} -X -r ${.TARGET}
163 @mv a.out ${.TARGET}