-MDIR= ${DESTDIR}/usr/man/cat3
-
-.c.o:
-#### generate additional code for profiling (-p)
- ${CC} -p ${CFLAGS} -c $*.c
-#### generate relocation bits (-r) & preserve symbols that begin with L (-X)
- -ld -X -r $*.o
- mv a.out profiled/$*.o
- ${CC} ${CFLAGS} -c $*.c
-#### generate relocation bits (-r) but don't preserve local symbols (-x)
- -ld -x -r $*.o
- mv a.out $*.o
-
-all: libm.a libm_p.a
-
-libm.a libm_p.a: ${OBJS} more.${MACHINE}
- @echo building normal libm
- @ar cru libm.a ${OBJS}
- ranlib libm.a
- @echo building profiled libm
- @cd profiled; ar cru ../libm_p.a ${OBJS}
- ranlib libm_p.a
-
-more.ieee: FRC
- for i in common ieee; do (cd $$i; make ${MFLAGS}); done
-
-more.national: FRC
- for i in common national; do (cd $$i; make ${MFLAGS}); done
-
-more.tahoe: FRC
- for i in common tahoe; do (cd $$i; make ${MFLAGS}); done
-
-more.vax: FRC
- cd vax; make "CFLAGS=${CFLAGS}"
-
-clean:
- rm -f ${OBJS} profiled/*.o core libm.a libm_p.a
- for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
-
-cleandir: clean
- rm -f ${MAN} tags .depend
-
-depend:
- mkdep ${CFLAGS} ${SRCS}
- for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
-
-install: ${MAN}
- install -o bin -g bin -m 444 libm.a ${DESTDIR}/usr/lib/libm.a
- ranlib -t ${DESTDIR}/usr/lib/libm.a
- install -o bin -g bin -m 444 libm_p.a ${DESTDIR}/usr/lib/libm_p.a
- ranlib -t ${DESTDIR}/usr/lib/libm_p.a
- install -c -o bin -g bin -m 444 ${MAN} ${MDIR}
- rm -f ${MDIR}/acosh.0; ln ${MDIR}/asinh.0 ${MDIR}/acosh.0
- rm -f ${MDIR}/atanh.0; ln ${MDIR}/asinh.0 ${MDIR}/atanh.0
- rm -f ${MDIR}/erfc.0; ln ${MDIR}/erf.0 ${MDIR}/erfc.0
- rm -f ${MDIR}/expm1.0; ln ${MDIR}/exp.0 ${MDIR}/expm1.0
- rm -f ${MDIR}/log.0; ln ${MDIR}/exp.0 ${MDIR}/log.0
- rm -f ${MDIR}/log10.0; ln ${MDIR}/exp.0 ${MDIR}/log10.0
- rm -f ${MDIR}/log1p.0; ln ${MDIR}/exp.0 ${MDIR}/log1p.0
- rm -f ${MDIR}/pow.0; ln ${MDIR}/exp.0 ${MDIR}/pow.0
- rm -f ${MDIR}/fabs.0; ln ${MDIR}/floor.0 ${MDIR}/fabs.0
- rm -f ${MDIR}/ceil.0; ln ${MDIR}/floor.0 ${MDIR}/ceil.0
- rm -f ${MDIR}/rint.0; ln ${MDIR}/floor.0 ${MDIR}/rint.0
- rm -f ${MDIR}/cabs.0; ln ${MDIR}/hypot.0 ${MDIR}/cabs.0
- rm -f ${MDIR}/copysign.0; ln ${MDIR}/ieee.0 ${MDIR}/copysign.0
- rm -f ${MDIR}/drem.0; ln ${MDIR}/ieee.0 ${MDIR}/drem.0
- rm -f ${MDIR}/finite.0; ln ${MDIR}/ieee.0 ${MDIR}/finite.0
- rm -f ${MDIR}/logb.0; ln ${MDIR}/ieee.0 ${MDIR}/logb.0
- rm -f ${MDIR}/scalb.0; ln ${MDIR}/ieee.0 ${MDIR}/scalb.0
- rm -f ${MDIR}/j1.0; ln ${MDIR}/j0.0 ${MDIR}/j1.0
- rm -f ${MDIR}/jn.0; ln ${MDIR}/j0.0 ${MDIR}/jn.0
- rm -f ${MDIR}/y0.0; ln ${MDIR}/j0.0 ${MDIR}/y0.0
- rm -f ${MDIR}/y1.0; ln ${MDIR}/j0.0 ${MDIR}/y1.0
- rm -f ${MDIR}/yn.0; ln ${MDIR}/j0.0 ${MDIR}/yn.0
- rm -f ${MDIR}/gamma.0; ln ${MDIR}/lgamma.0 ${MDIR}/gamma.0
- rm -f ${MDIR}/tan.0; ln ${MDIR}/sin.0 ${MDIR}/tan.0
- rm -f ${MDIR}/acos.0; ln ${MDIR}/sin.0 ${MDIR}/acos.0
- rm -f ${MDIR}/asin.0; ln ${MDIR}/sin.0 ${MDIR}/asin.0
- rm -f ${MDIR}/atan.0; ln ${MDIR}/sin.0 ${MDIR}/atan.0
- rm -f ${MDIR}/atan2.0; ln ${MDIR}/sin.0 ${MDIR}/atan2.0
- rm -f ${MDIR}/cos.0; ln ${MDIR}/sin.0 ${MDIR}/cos.0
- rm -f ${MDIR}/cosh.0; ln ${MDIR}/sinh.0 ${MDIR}/cosh.0
-
-lint: ${SRCS}
- lint ${CFLAGS} ${SRCS}
-
-tags: ${SRCS}
- ctags ${SRCS}
- for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} tags); done
-
-FRC:
+
+MLINKS+=asinh.3 acosh.3 asinh.3 atanh.3
+MLINKS+=erf.3 erfc.3
+MLINKS+=exp.3 expm1.3 exp.3 log.3 exp.3 log10.3 exp.3 log1p.3 exp.3 pow.3
+MLINKS+=floor.3 fabs.3 floor.3 ceil.3 floor.3 rint.3
+MLINKS+=hypot.3 cabs.3
+MLINKS+=ieee.3 copysign.3 ieee.3 drem.3 ieee.3 finite.3 ieee.3 logb.3 \
+ ieee.3 scalb.3
+MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 yn.3
+MLINKS+=lgamma.3 gamma.3
+MLINKS+=sin.3 tan.3 sin.3 acos.3 sin.3 asin.3 sin.3 atan.3 sin.3 atan2.3 \
+ sin.3 cos.3
+MLINKS+=sinh.3 cosh.3
+
+# can't use the standard mkdep, because there are some .s files that
+# are using '#' as a comment indicator and cpp thinks it's an undefined
+# control.
+
+depend: ${SRCS}
+ mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
+
+.include <bsd.lib.mk>
+
+.s.o:
+ ${AS} -o ${.TARGET} ${.IMPSRC}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
+
+.s.po:
+ sed -f ${.CURDIR}/${HARDWARE}/mcount.sed ${.IMPSRC} | \
+ ${AS} -o ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}