xref: /original-bsd/lib/libm/Makefile (revision 10020db5)
1#	@(#)Makefile	1.12 (Berkeley) 05/11/90
2#
3# This high quality math library is intended to run on either a VAX in
4# D_floating format or a machine that conforms to the IEEE standard 754
5# for double precision floating-point arithmetic.
6#
7# WARNING: On machines other than the ones mentioned above, run the original
8# Version 7 math library, if nothing better is available.
9#
10# HARDWARE indicates the type of floating point hardware you are using;
11# we use MACHINE because we don't have anything better.
12# Current legal values are:
13#
14# vax		- for the VAX D_floating format, the default.
15# tahoe		- for the TAHOE double format.
16# national	- for those IEEE machines whose floating point implementation
17#		  has similar byte ordering as the NATIONAL 32016 with 32081.
18# ieee		- for other IEEE machines, we hope.
19
20LIB=	m
21HARDWARE=${MACHINE}
22CFLAGS+=-D${HARDWARE} -I${.CURDIR}/common_source
23.PATH:	${.CURDIR}/common_source
24
25SRCS=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c exp.c \
26	exp__E.c expm1.c floor.c fmod.c lgamma.c j0.c j1.c jn.c log.c \
27	log10.c log1p.c log__L.c pow.c sinh.c tanh.c
28
29MAN3+=	abs.0 asinh.0 erf.0 exp.0 floor.0 hypot.0 ieee.0 infnan.0 j0.0 \
30	lgamma.0 math.0 sin.0 sinh.0 sqrt.0
31
32MLINKS+=asinh.3 acosh.3 asinh.3 atanh.3
33MLINKS+=erf.3 erfc.3
34MLINKS+=exp.3 expm1.3 exp.3 log.3 exp.3 log10.3 exp.3 log1p.3 exp.3 pow.3
35MLINKS+=floor.3 fabs.3 floor.3 ceil.3 floor.3 rint.3
36MLINKS+=hypot.3 cabs.3
37MLINKS+=ieee.3 copysign.3 ieee.3 drem.3 ieee.3 finite.3 ieee.3 logb.3 \
38	ieee.3 scalb.3
39MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 yn.3
40MLINKS+=lgamma.3 gamma.3
41MLINKS+=sin.3 tan.3 sin.3 acos.3 sin.3 asin.3 sin.3 atan.3 sin.3 atan2.3 \
42	sin.3 cos.3
43MLINKS+=sinh.3 cosh.3
44
45.if $(HARDWARE) == "ieee"
46.PATH:	${.CURDIR}/common ${.CURDIR}/ieee
47SRCS+=	atan2.c sincos.c tan.c				# common
48SRCS+=	cabs.c cbrt.c support.c				# ieee
49.endif
50
51.if $(HARDWARE) == "national"
52.PATH:	${.CURDIR}/common ${.CURDIR}/national
53SRCS+=	atan2.c sincos.c tan.c				# common
54SRCS+=	cabs.c cbrt.c sqrt.s support.s			# national
55.endif
56
57.if $(HARDWARE) == "tahoe"
58.PATH:	${.CURDIR}/common ${.CURDIR}/tahoe
59SRCS+=	atan2.c sincos.c tan.c				# common
60SRCS+=	cabs.s cbrt.s sqrt.s support.s infnan.s		# tahoe
61.endif
62
63.if $(HARDWARE) == "vax"
64.PATH:	${.CURDIR}/vax
65SRCS+=	atan2.s cabs.s cbrt.s sqrt.s sincos.s tan.s \
66	argred.s support.s infnan.s			# vax
67.endif
68
69# can't use the standard mkdep, because there are some .s files that
70# are using '#' as a comment indicator and cpp thinks it's an undefined
71# control.
72
73depend: ${SRCS}
74	mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
75
76.include <bsd.lib.mk>
77
78.s.o:
79	${AS} -o ${.TARGET} ${.IMPSRC}
80	@${LD} -x -r ${.TARGET}
81	@mv a.out ${.TARGET}
82
83.s.po:
84	sed -f ${.CURDIR}/${HARDWARE}/mcount.sed ${.IMPSRC} | \
85	    ${AS} -o ${.TARGET}
86	@${LD} -X -r ${.TARGET}
87	@mv a.out ${.TARGET}
88
89