fix profiling.
[unix-history] / usr / src / lib / libm / Makefile
CommitLineData
a63658f1 1# @(#)Makefile 5.16 (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
a63658f1
KB
34SRCS+= acosh.c asinh.c erf.c exp.c exp__E.c fmod.c gamma.c lgamma.c \
35 j0.c j1.c log.c log__L.c pow.c
76beb36b 36# mc68881
ed4e7f8c 37SRCS+= asincos.s atan.s atan2.c atanh.s cosh.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 \
a63658f1
KB
49 exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c \
50 jn.c log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
297cf220
RC
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
a63658f1
KB
62 exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c \
63 jn.c log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
a87254a0
WN
64# common
65SRCS+= atan2.c sincos.c tan.c
66# ieee
67SRCS+= cabs.c cbrt.c support.c
68
69.elif (${MACHINE} == "national")
70
71HARDWARE=${MACHINE}
72.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/national \
76beb36b
KB
73.elif (${MACHINE} == "national")
74
770d844a 75HARDWARE=${MACHINE}
76beb36b
KB
76.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/national \
77 ${.CURDIR}/ieee
78# common_source
a63658f1
KB
79 exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c \
80 log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
76beb36b
KB
81# common
82SRCS+= atan2.c sincos.c tan.c
83# national
84SRCS+= sqrt.s support.s
85# ieee
86SRCS+= cabs.c cbrt.c
e7e6d508 87
f183e89d
KB
88.elif (${MACHINE} == "sparc")
89
90HARDWARE=${MACHINE}
91.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/ieee
92# common_source
93SRCS+= acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
04e1c1d0
CT
94 exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c \
95 jn.c log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
f183e89d
KB
96# XXX should do sqrt & support functions in assembly
97# common
98SRCS+= atan2.c sincos.c tan.c
99# ieee
100SRCS+= cabs.c cbrt.c support.c
101
76beb36b
KB
102.elif (${MACHINE} == "tahoe")
103
104HARDWARE=${MACHINE}
105.PATH: ${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/tahoe \
106# common_source
a63658f1
KB
107 exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c \
108 log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
76beb36b
KB
109# common
110SRCS+= atan2.c sincos.c tan.c
111# tahoe
112SRCS+= cabs.s cbrt.s sqrt.s support.s infnan.s
113
114.elif (${MACHINE} == "vax")
115
116HARDWARE=${MACHINE}
117.PATH: ${.CURDIR}/common_source ${.CURDIR}/vax
118# common_source
a63658f1
KB
119 exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c \
120 log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
76beb36b
KB
121# vax
122SRCS+= atan2.s cabs.s cbrt.s sqrt.s sincos.s tan.s argred.s support.s \
123 infnan.s
124
125.endif
e7e6d508 126
34a78eae
CL
127MAN3+= acos.0 acosh.0 asin.0 asinh.0 atan.0 atan2.0 atanh.0 ceil.0 \
128 cos.0 cosh.0 erf.0 exp.0 fabs.0 floor.0 fmod.0 hypot.0 ieee.0 \
129 infnan.0 j0.0 lgamma.0 math.0 rint.0 sin.0 sinh.0 sqrt.0 \
130 tan.0 tanh.0
e0085737 131
770d844a
KB
132MLINKS+=erf.3 erfc.3
133MLINKS+=exp.3 expm1.3 exp.3 log.3 exp.3 log10.3 exp.3 log1p.3 exp.3 pow.3
770d844a
KB
134MLINKS+=hypot.3 cabs.3
135MLINKS+=ieee.3 copysign.3 ieee.3 drem.3 ieee.3 finite.3 ieee.3 logb.3 \
136 ieee.3 scalb.3
137MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 yn.3
138MLINKS+=lgamma.3 gamma.3
e0085737 139
770d844a
KB
140# can't use the standard mkdep, because there are some .s files that
141# are using '#' as a comment indicator and cpp thinks it's an undefined
142# control.
a73667b8 143
a201c6cd
KB
144depend: .depend
145.depend: ${SRCS}
770d844a 146 mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
e7e6d508 147
770d844a 148.include <bsd.lib.mk>
a73667b8 149
770d844a
KB
150.s.o:
151 ${AS} -o ${.TARGET} ${.IMPSRC}
152 @${LD} -x -r ${.TARGET}
153 @mv a.out ${.TARGET}
e0085737 154
770d844a
KB
155.s.po:
156 sed -f ${.CURDIR}/${HARDWARE}/mcount.sed ${.IMPSRC} | \
157 ${AS} -o ${.TARGET}
158 @${LD} -X -r ${.TARGET}
159 @mv a.out ${.TARGET}