xref: /original-bsd/lib/libm/Makefile (revision d0e3910b)
1#
2# Copyright (c) 1987 Regents of the University of California.
3# All rights reserved.
4#
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#
12#	@(#)Makefile	1.8 (Berkeley) 12/07/87
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.
20#
21# MACHINE indicates the type of floating point hardware you are using; legal
22# values are:
23#
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
27#		  has similar byte ordering as the NATIONAL 32016 with 32081.
28# ieee		- for other IEEE machines, we hope.
29#
30CFLAGS=	-O -D${MACHINE}
31LIBC=	/lib/libc.a
32SUBDIR=	vax tahoe national common ieee
33#
34# Files comprising the standard Math library;
35# actually there are more under ${MACHINE}/ subdirectory.
36#
37SRCS=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c \
38	exp.c exp__E.c expm1.c floor.c lgamma.c j0.c j1.c jn.c \
39	log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
40OBJS=	acosh.o asincos.o asinh.o atan.o atanh.o cosh.o erf.o \
41	exp.o exp__E.o expm1.o floor.o lgamma.o j0.o j1.o jn.o \
42	log.o log10.o log1p.o log__L.o pow.o sinh.o tanh.o
43
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
57libm.a libm_p.a: ${OBJS} more.${MACHINE}
58	cd profiled; ar cru ../libm_p.a ${OBJS}
59	ar cru libm.a ${OBJS}
60
61more.ieee: FRC
62	for i in common ieee; do (cd $$i; make ${MFLAGS}); done
63
64more.national: FRC
65	for i in common national; do (cd $$i; make ${MFLAGS}); done
66
67more.tahoe: FRC
68	for i in common tahoe; do (cd $$i; make ${MFLAGS}); done
69
70more.vax: FRC
71	cd vax; make "CFLAGS=${CFLAGS}"
72
73clean: FRC
74	rm -f ${OBJS} profiled/*.o core libm.a libm_p.a
75	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
76
77depend: FRC
78	mkdep ${CFLAGS} ${SRCS}
79	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
80
81install: FRC
82	install -o bin -g bin -m 644 libm.a ${DESTDIR}/usr/lib/libm.a
83	ranlib ${DESTDIR}/usr/lib/libm.a
84	install -o bin -g bin -m 644 libm_p.a ${DESTDIR}/usr/lib/libm_p.a
85	ranlib ${DESTDIR}/usr/lib/libm_p.a
86
87lint: FRC
88	lint ${CFLAGS} ${SRCS}
89
90tags: FRC
91	ctags ${SRCS}
92	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} tags); done
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
103atanh.o: atanh.c /usr/include/errno.h
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
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
115log10.o: log10.c
116log1p.o: log1p.c /usr/include/errno.h
117log__L.o: log__L.c
118pow.o: pow.c /usr/include/errno.h
119sinh.o: sinh.c
120tanh.o: tanh.c
121
122# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
123