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