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