1# 2# @(#)Makefile 4.9 9/11/85; 1.2 (ucb.elefunt) 09/11/85 3# 4SCCSID = "@(#)Makefile 4.9 9/11/85; 1.2 (ucb.elefunt) 09/11/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# actually there are more under ${MACH}/ 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 40 41FILES = acosh.o asincos.o asinh.o atan.o atanh.o cosh.o erf.o \ 42 exp.o exp__E.o expm1.o floor.o lgamma.o j0.o j1.o jn.o \ 43 log.o log10.o log1p.o log__L.o pow.o sinh.o tanh.o 44 45TAGSFILE=tags 46 47.c.o: 48#### generate additional code for profiling (-p) 49 ${CC} -p ${CFLAGS} -c $*.c 50#### generate relocation bits (-r) & preserve symbols that begin with L (-X) 51 -ld -X -r $*.o 52 mv a.out profiled/$*.o 53 ${CC} ${CFLAGS} -c $*.c 54#### generate relocation bits (-r) but don't preserve local symbols (-x) 55 -ld -x -r $*.o 56 mv a.out $*.o 57 58all: libm.a libm_p.a 59 60libm.a libm_p.a: ${FILES} more 61 cd profiled; ar cru ../libm_p.a ${FILES} 62 ar cru libm.a ${FILES} 63 64more: 65 @cd ${MACH}; make "MACH=${MACH}" "CFLAGS=${CFLAGS}" 66 67install: libm.a libm_p.a 68 -rm -f ${DESTDIR}/usr/lib/libnm.a ${DESTDIR}/usr/lib/libnm_p.a 69 ${INSTALL} libm.a ${DESTDIR}/usr/lib 70 ln ${DESTDIR}/usr/lib/libm.a ${DESTDIR}/usr/lib/libnm.a 71 ranlib ${DESTDIR}/usr/lib/libm.a 72 ${INSTALL} libm_p.a ${DESTDIR}/usr/lib 73 ln ${DESTDIR}/usr/lib/libm_p.a ${DESTDIR}/usr/lib/libnm_p.a 74 ranlib ${DESTDIR}/usr/lib/libm_p.a 75 76tags: 77 cwd=`pwd`; \ 78 for i in ${SRCS}; do \ 79 ctags -a -f ${TAGSFILE} $$cwd/$$i; \ 80 done 81 82clean: 83 -rm -f *.o ${MACH}/*.o profiled/*.o libm.a libm_p.a tags 84