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