add Berkeley specific headers
[unix-history] / usr / src / lib / libm / Makefile
CommitLineData
e7e6d508 1#
e0085737 2# Copyright (c) 1987 Regents of the University of California.
2927cf78 3# All rights reserved.
e7e6d508 4#
2927cf78
KB
5# Redistribution and use in source and binary forms are permitted
6# provided that this notice is preserved and that due credit is given
7# to the University of California at Berkeley. The name of the University
8# may not be used to endorse or promote products derived from this
9# software without specific written prior permission. This software
10# is provided ``as is'' without express or implied warranty.
11#
e99ec930 12# @(#)Makefile 1.8 (Berkeley) %G%
e7e6d508
ZAL
13#
14# This high quality math library is intended to run on either a VAX in
15# D_floating format or a machine that conforms to the IEEE standard 754
16# for double precision floating-point arithmetic.
17#
18# WARNING: On machines other than the ones mentioned above, run the original
19# Version 7 math library, if nothing better is available.
e7e6d508 20#
e0085737 21# MACHINE indicates the type of floating point hardware you are using; legal
e7e6d508
ZAL
22# values are:
23#
859dc438
ZAL
24# vax - for the VAX D_floating format, the default.
25# tahoe - for the TAHOE double format.
26# national - for those IEEE machines whose floating point implementation
e7e6d508 27# has similar byte ordering as the NATIONAL 32016 with 32081.
859dc438 28# ieee - for other IEEE machines, we hope.
e7e6d508 29#
07a355c8 30CFLAGS= -O -D${MACHINE}
e0085737 31LIBC= /lib/libc.a
2927cf78 32SUBDIR= vax tahoe national common ieee
e7e6d508
ZAL
33#
34# Files comprising the standard Math library;
07a355c8 35# actually there are more under ${MACHINE}/ subdirectory.
e7e6d508 36#
e0085737 37SRCS= acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c \
a62df508 38 exp.c exp__E.c expm1.c floor.c lgamma.c j0.c j1.c jn.c \
e7e6d508 39 log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
e0085737 40OBJS= acosh.o asincos.o asinh.o atan.o atanh.o cosh.o erf.o \
a62df508 41 exp.o exp__E.o expm1.o floor.o lgamma.o j0.o j1.o jn.o \
e7e6d508
ZAL
42 log.o log10.o log1p.o log__L.o pow.o sinh.o tanh.o
43
e7e6d508
ZAL
44.c.o:
45#### generate additional code for profiling (-p)
46 ${CC} -p ${CFLAGS} -c $*.c
47#### generate relocation bits (-r) & preserve symbols that begin with L (-X)
48 -ld -X -r $*.o
49 mv a.out profiled/$*.o
50 ${CC} ${CFLAGS} -c $*.c
51#### generate relocation bits (-r) but don't preserve local symbols (-x)
52 -ld -x -r $*.o
53 mv a.out $*.o
54
55all: libm.a libm_p.a
56
e0085737
ZAL
57libm.a libm_p.a: ${OBJS} more.${MACHINE}
58 cd profiled; ar cru ../libm_p.a ${OBJS}
59 ar cru libm.a ${OBJS}
60
859dc438 61more.ieee: FRC
2927cf78 62 for i in common ieee; do (cd $$i; make ${MFLAGS}); done
e0085737 63
859dc438 64more.national: FRC
2927cf78 65 for i in common national; do (cd $$i; make ${MFLAGS}); done
ad8b7426 66
859dc438 67more.tahoe: FRC
2927cf78 68 for i in common tahoe; do (cd $$i; make ${MFLAGS}); done
07a355c8 69
859dc438
ZAL
70more.vax: FRC
71 cd vax; make "CFLAGS=${CFLAGS}"
e0085737
ZAL
72
73clean: FRC
e99ec930 74 rm -f ${OBJS} profiled/*.o core libm.a libm_p.a
2927cf78 75 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
e7e6d508 76
e0085737
ZAL
77depend: FRC
78 mkdep ${CFLAGS} ${SRCS}
2927cf78 79 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
e7e6d508 80
e0085737 81install: FRC
e0085737 82 install -o bin -g bin -m 644 libm.a ${DESTDIR}/usr/lib/libm.a
e7e6d508 83 ranlib ${DESTDIR}/usr/lib/libm.a
e0085737 84 install -o bin -g bin -m 644 libm_p.a ${DESTDIR}/usr/lib/libm_p.a
e7e6d508
ZAL
85 ranlib ${DESTDIR}/usr/lib/libm_p.a
86
e0085737
ZAL
87lint: FRC
88 lint ${CFLAGS} ${SRCS}
89
90tags: FRC
91 ctags ${SRCS}
2927cf78 92 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} tags); done
e0085737
ZAL
93
94FRC:
95
96# DO NOT DELETE THIS LINE -- mkdep uses it.
97# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
98
99acosh.o: acosh.c
100asincos.o: asincos.c
101asinh.o: asinh.c
102atan.o: atan.c
2927cf78 103atanh.o: atanh.c /usr/include/errno.h
e0085737
ZAL
104cosh.o: cosh.c
105erf.o: erf.c
106exp.o: exp.c
107exp__E.o: exp__E.c
108expm1.o: expm1.c
109floor.o: floor.c
2927cf78
KB
110lgamma.o: lgamma.c /usr/include/math.h /usr/include/errno.h
111j0.o: j0.c /usr/include/math.h /usr/include/errno.h
112j1.o: j1.c /usr/include/math.h /usr/include/errno.h
113jn.o: jn.c /usr/include/math.h /usr/include/errno.h
114log.o: log.c /usr/include/errno.h
e0085737 115log10.o: log10.c
2927cf78 116log1p.o: log1p.c /usr/include/errno.h
e0085737 117log__L.o: log__L.c
2927cf78 118pow.o: pow.c /usr/include/errno.h
e0085737
ZAL
119sinh.o: sinh.c
120tanh.o: tanh.c
e7e6d508 121
e0085737 122# IF YOU PUT ANYTHING HERE IT WILL GO AWAY