Makefile revision 1.5
1#	from: @(#)Makefile	5.11 (Berkeley) 12/2/92
2#	$Id: Makefile,v 1.5 1993/10/01 23:56:08 cgd Exp $
3#
4# ieee		- for most IEEE machines, we hope.
5# mc68881	- the, ahem, mc68881.
6# national	- for those ieee machines whose floating point implementation
7#		  has similar byte ordering as the NATIONAL 32016 with 32081.
8# i386		- i387 NPX, currently the same as "national"
9# mips		- for MIPS achitecture machines
10# tahoe		- for the tahoe double format.
11# vax		- for the vax D_floating format
12
13LIB=	m
14CFLAGS+=-I${.CURDIR}/common_source
15
16.if (${MACHINE} == "ieee")
17
18HARDWARE=${MACHINE}
19.PATH:	${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/ieee
20# common_source
21SRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c exp__D.c \
22	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c log.c \
23	log10.c log1p.c log__D.c log__L.c logtab.c pow.c sinh.c tanh.c
24# common
25SRCS+=	atan2.c sincos.c tan.c
26# ieee
27SRCS+=	cabs.c cbrt.c support.c
28
29.elif (${MACHINE} == "hp300" || ${MACHINE} == "luna68k")
30
31HARDWARE=mc68881
32.PATH:	${.CURDIR}/mc68881 ${.CURDIR}/common_source ${.CURDIR}/ieee
33# common_source
34SRCS+=	acosh.c asinh.c erf.c exp__D.c exp__E.c fmod.c gamma.c lgamma.c j0.c \
35	j1.c log__D.c log__L.c logtab.c pow.c
36# mc68881
37SRCS+=	asincos.s atan.s atan2.c atanh.s cosh.s exp.s expm1.s floor.s \
38	log.s log10.s log1p.s sincos.s sinh.s sqrt.s support.s tan.s tanh.s
39# ieee
40SRCS+=	cabs.c cbrt.c
41
42.elif (${MACHINE} == "i386")
43
44HARDWARE=i387
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 exp__D.c \
49	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c log.c \
50	log10.c log1p.c log__D.c log__L.c logtab.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
60CFLAGS+= -Dnational
61# common_source
62SRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c exp__D.c \
63	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c log.c \
64	log10.c log1p.c log__D.c log__L.c logtab.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 \
74.elif (${MACHINE} == "national")
75
76HARDWARE=${MACHINE}
77.PATH:	${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/national \
78	${.CURDIR}/ieee
79# common_source
80SRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c exp__D.c \
81	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c log.c \
82	log10.c log1p.c log__D.c log__L.c logtab.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
89
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 exp__D.c \
96	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c log.c \
97	log10.c log1p.c log__D.c log__L.c logtab.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
104.elif (${MACHINE} == "tahoe")
105
106HARDWARE=${MACHINE}
107.PATH:	${.CURDIR}/common_source ${.CURDIR}/common ${.CURDIR}/tahoe \
108# common_source
109SRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c exp__D.c \
110	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c log.c \
111	log10.c log1p.c log__D.c log__L.c logtab.c pow.c sinh.c tanh.c
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
122SRCS+=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c exp__D.c \
123	exp__E.c expm1.c floor.c fmod.c gamma.c lgamma.c j0.c j1.c jn.c log.c \
124	log10.c log1p.c log__D.c log__L.c logtab.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
130
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
135
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
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
143
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.
147
148depend: .depend
149.depend: ${SRCS}
150	mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
151
152.include <bsd.lib.mk>
153
154.s.o:
155	${AS} -o ${.TARGET} ${.IMPSRC}
156	@${LD} -x -r ${.TARGET}
157	@mv a.out ${.TARGET}
158
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}
164