Makefile revision 1.38
11.38Scgd#	$NetBSD: Makefile,v 1.38 1998/01/21 21:23:18 cgd Exp $
21.1Scgd
31.1ScgdLIB=	kern
41.1ScgdNOPIC=
51.9Sderaadt
61.29SmycroftM=	${.CURDIR}/arch/${MACHINE_ARCH}
71.20Schristos
81.32ScgdCPPFLAGS=	-I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS}
91.29Smycroft
101.29Smycroft.if exists ($M/Makefile.inc)
111.29Smycroft.PATH:	$M
121.29Smycroft.include "$M/Makefile.inc"
131.1Scgd.endif
141.5Scgd
151.19Scgd.if (${MACHINE_ARCH} != "alpha")
161.5Scgd# Quad support
171.5ScgdSRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
181.5Scgd	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
191.5Scgd	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
201.19Scgd.endif
211.8Scgd
221.8Scgd# Other stuff
231.33SthorpejSRCS+=	md5c.c
241.27Sscottr
251.27Sscottr# Files to clean up
261.27SscottrCLEANFILES+= lib${LIB}.o lib${LIB}.po
271.5Scgd
281.38Scgd#
291.38Scgd# Special rules for certain objects
301.38Scgd#
311.38Scgd
321.11Scgd# mcount cannot be compiled with profiling
331.11Scgdmcount.po: mcount.o
341.11Scgd	cp mcount.o mcount.po
351.38Scgd
361.38Scgd# if no machine specific strchr(3), build one out of index(3).
371.38Scgd.if empty(SRCS:Mstrchr.S)
381.38ScgdOBJS+=	strchr.o
391.38Scgdstrchr.o: index.c
401.38Scgd	${COMPILE.c} -DSTRCHR ${.ALLSRC} -o ${.TARGET}
411.38Scgd	@${LD} -x -r ${.TARGET}
421.38Scgd	@mv a.out ${.TARGET}
431.38Scgd
441.38Scgdstrchr.po: index.c
451.38Scgd	${COMPILE.c} -DSTRCHR -p ${.ALLSRC} -o ${.TARGET}
461.38Scgd	@${LD} -X -r ${.TARGET}
471.38Scgd	@mv a.out ${.TARGET}
481.38Scgd
491.38Scgdstrchr.so: index.c
501.38Scgd	${COMPILE.c} ${PICFLAG} -DPIC -DSTRCHR ${.ALLSRC} -o ${.TARGET}
511.38Scgd
521.38ScgdLOBJS+= strchr.ln
531.38Scgdstrchr.ln: index.c
541.38Scgd	${LINT} -DSTRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
551.38Scgd	    ${.ALLSRC}
561.38Scgd.endif
571.38Scgd
581.38Scgd# if no machine specific strrchr(3), build one out of rindex(3).
591.38Scgd.if empty(SRCS:Mstrrchr.S)
601.38ScgdOBJS+=	strrchr.o
611.38Scgdstrrchr.o: rindex.c
621.38Scgd	${COMPILE.c} -DSTRRCHR ${.ALLSRC} -o ${.TARGET}
631.38Scgd	@${LD} -x -r ${.TARGET}
641.38Scgd	@mv a.out ${.TARGET}
651.38Scgd
661.38Scgdstrrchr.po: rindex.c
671.38Scgd	${COMPILE.c} -DSTRRCHR -p ${.ALLSRC} -o ${.TARGET}
681.38Scgd	@${LD} -X -r ${.TARGET}
691.38Scgd	@mv a.out ${.TARGET}
701.38Scgd
711.38Scgdstrrchr.so: rindex.c
721.38Scgd	${COMPILE.c} ${PICFLAG} -DPIC -DSTRRCHR ${.ALLSRC} -o ${.TARGET}
731.38Scgd
741.38ScgdLOBJS+= strrchr.ln
751.38Scgdstrrchr.ln: rindex.c
761.38Scgd	${LINT} -DSTRRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
771.38Scgd	    ${.ALLSRC}
781.38Scgd.endif
791.36Scjs
801.36Scjs# only needed during build
811.36Scjslibinstall::
821.1Scgd
831.1Scgd.include <bsd.lib.mk>
841.23Smycroft
851.23Smycroftlib${LIB}.o:: ${OBJS}
861.23Smycroft	@echo building standard ${LIB} library
871.23Smycroft	@rm -f lib${LIB}.o
881.37Sgwr	@${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}`
891.23Smycroft
901.23SmycroftPOBJS+=	${OBJS:.o=.po} mcount.po
911.23Smycroftlib${LIB}.po:: ${POBJS}
921.23Smycroft	@echo building profiled ${LIB} library
931.23Smycroft	@rm -f lib${LIB}.po
941.37Sgwr	@${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}`
95