xref: /original-bsd/old/libm/libm/Makefile (revision 81f6297c)
1#
2#	@(#)Makefile	4.5	06/05/85
3#
4SCCSID = "@(#)Makefile 4.5 06/05/85"
5#
6# This high quality math library is intended to run on either a VAX in
7# D_floating format or a machine that conforms to the IEEE standard 754
8# for double precision floating-point arithmetic.
9#
10# WARNING: On machines other than the ones mentioned above, run the original
11# Version 7 math library, if nothing better is available.
12
13#
14# MACH indicates the type of floating point hardware you are using; legal
15# values are:
16#
17# VAX		- for the VAX D_floating format, the default.
18# NATIONAL	- for those IEEE machines whose floating point implementation
19#		  has similar byte ordering as the NATIONAL 32016 with 32081.
20# IEEE		- for other IEEE machines, we hope.
21#
22MACH=VAX
23
24#
25# invoke object-code optimizer with appropriate MACH definition
26#
27CFLAGS=-O -D${MACH}
28
29INSTALL=install
30
31DESTDIR=
32
33#
34# files comprising the standard Math library
35#
36SRCS=	E.c L.c acosh.c asinh.c atanh.c atrig.c cosh.c \
37	erf.c exp.c exp__E.c floor.c gamma.c j0.c j1.c jn.c \
38	log.c log10.c log__L.c pow.c sinh.c tanh.c
39FILES=cosh.o sinh.o tanh.o acosh.o asinh.o atanh.o atrig.o \
40E.o L.o exp.o log.o log10.o pow.o exp__E.o log__L.o \
41jn.o j0.o j1.o gamma.o erf.o floor.o
42MORE=\
43${MACH}/atan2.o ${MACH}/cbrt.o ${MACH}/trig.o ${MACH}/cabs.o ${MACH}/support.o
44TAGSFILE=tags
45
46.c.o:
47####	generate additional code for profiling (-p)
48	${CC} -p ${CFLAGS} -c $*.c
49####	generate relocation bits (-r) & preserve symbols that begin with L (-X)
50	-ld -X -r $*.o
51	mv a.out profiled/$*.o
52	${CC} ${CFLAGS} -c $*.c
53####	generate relocation bits (-r) but don't preserve local symbols (-x)
54	-ld -x -r $*.o
55	mv a.out $*.o
56
57libm.a libm_p.a : ${FILES}
58	cd ${MACH}; make "MACH=${MACH}" "CFLAGS=${CFLAGS}"
59	cd profiled; ar cru ../libm_p.a ${FILES} ${MORE}
60	ar cru libm.a ${FILES} ${MORE}
61
62install: libm.a libm_p.a
63	${INSTALL} libm.a ${DESTDIR}/usr/lib
64	ln ${DESTDIR}/usr/lib/libm.a ${DESTDIR}/usr/lib/libnm.a
65	ranlib ${DESTDIR}/usr/lib/libm.a
66	${INSTALL} libm_p.a ${DESTDIR}/usr/lib
67	ln ${DESTDIR}/usr/lib/libm_p.a ${DESTDIR}/usr/lib/libnm_p.a
68	ranlib ${DESTDIR}/usr/lib/libm_p.a
69
70tags:
71	cwd=`pwd`; \
72	for i in ${SRCS}; do \
73		ctags -a -f ${TAGSFILE} $$cwd/$$i; \
74	done
75
76clean:
77	-rm -f *.o ${MACH}/*.o profiled/*.o profiled/${MACH}/*.o \
78	    libm.a libm_p.a tags
79