xref: /original-bsd/lib/libm/Makefile (revision 6f738a42)
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 the above copyright notice and this paragraph are
7# duplicated in all such forms and that any documentation,
8# advertising materials, and other materials related to such
9# distribution and use acknowledge that the software was developed
10# by the University of California, Berkeley.  The name of the
11# University may not be used to endorse or promote products derived
12# from this software without specific prior written permission.
13# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16#
17#	@(#)Makefile	1.9 (Berkeley) 06/30/88
18#
19# This high quality math library is intended to run on either a VAX in
20# D_floating format or a machine that conforms to the IEEE standard 754
21# for double precision floating-point arithmetic.
22#
23# WARNING: On machines other than the ones mentioned above, run the original
24# Version 7 math library, if nothing better is available.
25#
26# MACHINE indicates the type of floating point hardware you are using; legal
27# values are:
28#
29# vax		- for the VAX D_floating format, the default.
30# tahoe		- for the TAHOE double format.
31# national	- for those IEEE machines whose floating point implementation
32#		  has similar byte ordering as the NATIONAL 32016 with 32081.
33# ieee		- for other IEEE machines, we hope.
34#
35CFLAGS=	-O -D${MACHINE}
36LIBC=	/lib/libc.a
37SUBDIR=	vax tahoe national common ieee
38#
39# Files comprising the standard Math library;
40# actually there are more under ${MACHINE}/ subdirectory.
41#
42SRCS=	acosh.c asincos.c asinh.c atan.c atanh.c cosh.c erf.c \
43	exp.c exp__E.c expm1.c floor.c lgamma.c j0.c j1.c jn.c \
44	log.c log10.c log1p.c log__L.c pow.c sinh.c tanh.c
45OBJS=	acosh.o asincos.o asinh.o atan.o atanh.o cosh.o erf.o \
46	exp.o exp__E.o expm1.o floor.o lgamma.o j0.o j1.o jn.o \
47	log.o log10.o log1p.o log__L.o pow.o sinh.o tanh.o
48
49.c.o:
50####	generate additional code for profiling (-p)
51	${CC} -p ${CFLAGS} -c $*.c
52####	generate relocation bits (-r) & preserve symbols that begin with L (-X)
53	-ld -X -r $*.o
54	mv a.out profiled/$*.o
55	${CC} ${CFLAGS} -c $*.c
56####	generate relocation bits (-r) but don't preserve local symbols (-x)
57	-ld -x -r $*.o
58	mv a.out $*.o
59
60all: libm.a libm_p.a
61
62libm.a libm_p.a: ${OBJS} more.${MACHINE}
63	cd profiled; ar cru ../libm_p.a ${OBJS}
64	ar cru libm.a ${OBJS}
65
66more.ieee: FRC
67	for i in common ieee; do (cd $$i; make ${MFLAGS}); done
68
69more.national: FRC
70	for i in common national; do (cd $$i; make ${MFLAGS}); done
71
72more.tahoe: FRC
73	for i in common tahoe; do (cd $$i; make ${MFLAGS}); done
74
75more.vax: FRC
76	cd vax; make "CFLAGS=${CFLAGS}"
77
78clean: FRC
79	rm -f ${OBJS} profiled/*.o core libm.a libm_p.a
80	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
81
82depend: FRC
83	mkdep ${CFLAGS} ${SRCS}
84	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
85
86install: FRC
87	install -o bin -g bin -m 644 libm.a ${DESTDIR}/usr/lib/libm.a
88	ranlib ${DESTDIR}/usr/lib/libm.a
89	install -o bin -g bin -m 644 libm_p.a ${DESTDIR}/usr/lib/libm_p.a
90	ranlib ${DESTDIR}/usr/lib/libm_p.a
91
92lint: FRC
93	lint ${CFLAGS} ${SRCS}
94
95tags: FRC
96	ctags ${SRCS}
97	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} tags); done
98
99FRC:
100
101# DO NOT DELETE THIS LINE -- mkdep uses it.
102# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
103
104acosh.o: acosh.c
105asincos.o: asincos.c
106asinh.o: asinh.c
107atan.o: atan.c
108atanh.o: atanh.c /usr/include/errno.h
109cosh.o: cosh.c
110erf.o: erf.c
111exp.o: exp.c
112exp__E.o: exp__E.c
113expm1.o: expm1.c
114floor.o: floor.c
115lgamma.o: lgamma.c /usr/include/math.h /usr/include/errno.h
116j0.o: j0.c /usr/include/math.h /usr/include/errno.h
117j1.o: j1.c /usr/include/math.h /usr/include/errno.h
118jn.o: jn.c /usr/include/math.h /usr/include/errno.h
119log.o: log.c /usr/include/errno.h
120log10.o: log10.c
121log1p.o: log1p.c /usr/include/errno.h
122log__L.o: log__L.c
123pow.o: pow.c /usr/include/errno.h
124sinh.o: sinh.c
125tanh.o: tanh.c
126
127# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
128