Makefile revision 1.44
11.44Sperry#	$NetBSD: Makefile,v 1.44 1998/07/31 23:44:41 perry 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.42SchristosSRCS+=	md5c.c sha1.c pmatch.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.40Smycroft
361.40Smycroft# if no machine specific memcpy(3), build one out of bcopy(3).
371.40Smycroft.if empty(SRCS:Mmemcpy.S)
381.40SmycroftOBJS+=	memcpy.o
391.40Smycroftmemcpy.o: bcopy.c
401.40Smycroft	@echo ${COMPILE.c:Q} -DMEMCOPY ${.ALLSRC} -o ${.TARGET}
411.40Smycroft	@${COMPILE.c} -DMEMCOPY ${.ALLSRC} -o ${.TARGET}.o
421.40Smycroft	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
431.40Smycroft	@rm -f ${.TARGET}.o
441.40Smycroft
451.40Smycroftmemcpy.po: bcopy.c
461.40Smycroft	@echo ${COMPILE.c:Q} -DMEMCOPY -pg ${.ALLSRC} -o ${.TARGET}
471.40Smycroft	@${COMPILE.c} -DMEMCOPY -pg ${.ALLSRC} -o ${.TARGET}.o
481.40Smycroft	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
491.40Smycroft	@rm -f ${.TARGET}.o
501.40Smycroft
511.40Smycroftmemcpy.so: bcopy.c
521.40Smycroft	@echo ${COMPILE.c:Q} -DMEMCOPY ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}
531.40Smycroft	@${COMPILE.c} -DMEMCOPY ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o
541.40Smycroft	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
551.40Smycroft	@rm -f ${.TARGET}.o
561.40Smycroft
571.40SmycroftLOBJS+= memcpy.ln
581.40Smycroftmemcpy.ln: bcopy.c
591.40Smycroft	${LINT} -DMEMCOPY ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
601.44Sperry	    ${.ALLSRC}
611.44Sperry.endif
621.44Sperry
631.44Sperry# if no machine specific memcpy(3), build one out of bcopy(3).
641.44Sperry.if empty(SRCS:Mmemmove.S)
651.44SperryOBJS+=	memmove.o
661.44Sperrymemmove.o: bcopy.c
671.44Sperry	@echo ${COMPILE.c:Q} -DMEMMOVE ${.ALLSRC} -o ${.TARGET}
681.44Sperry	@${COMPILE.c} -DMEMMOVE ${.ALLSRC} -o ${.TARGET}.o
691.44Sperry	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
701.44Sperry	@rm -f ${.TARGET}.o
711.44Sperry
721.44Sperrymemmove.po: bcopy.c
731.44Sperry	@echo ${COMPILE.c:Q} -DMEMMOVE -pg ${.ALLSRC} -o ${.TARGET}
741.44Sperry	@${COMPILE.c} -DMEMMOVE -pg ${.ALLSRC} -o ${.TARGET}.o
751.44Sperry	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
761.44Sperry	@rm -f ${.TARGET}.o
771.44Sperry
781.44Sperrymemmove.so: bcopy.c
791.44Sperry	@echo ${COMPILE.c:Q} -DMEMMOVE ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}
801.44Sperry	@${COMPILE.c} -DMEMMOVE ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o
811.44Sperry	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
821.44Sperry	@rm -f ${.TARGET}.o
831.44Sperry
841.44SperryLOBJS+= memmove.ln
851.44Sperrymemmove.ln: bcopy.c
861.44Sperry	${LINT} -DMEMMOVE ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
871.40Smycroft	    ${.ALLSRC}
881.40Smycroft.endif
891.38Scgd
901.38Scgd# if no machine specific strchr(3), build one out of index(3).
911.38Scgd.if empty(SRCS:Mstrchr.S)
921.38ScgdOBJS+=	strchr.o
931.38Scgdstrchr.o: index.c
941.39Scgd	@echo ${COMPILE.c:Q} -DSTRCHR ${.ALLSRC} -o ${.TARGET}
951.39Scgd	@${COMPILE.c} -DSTRCHR ${.ALLSRC} -o ${.TARGET}.o
961.39Scgd	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
971.39Scgd	@rm -f ${.TARGET}.o
981.38Scgd
991.38Scgdstrchr.po: index.c
1001.39Scgd	@echo ${COMPILE.c:Q} -DSTRCHR -pg ${.ALLSRC} -o ${.TARGET}
1011.39Scgd	@${COMPILE.c} -DSTRCHR -pg ${.ALLSRC} -o ${.TARGET}.o
1021.39Scgd	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
1031.39Scgd	@rm -f ${.TARGET}.o
1041.38Scgd
1051.38Scgdstrchr.so: index.c
1061.39Scgd	@echo ${COMPILE.c:Q} -DSTRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}
1071.39Scgd	@${COMPILE.c} -DSTRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o
1081.39Scgd	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
1091.39Scgd	@rm -f ${.TARGET}.o
1101.38Scgd
1111.38ScgdLOBJS+= strchr.ln
1121.38Scgdstrchr.ln: index.c
1131.38Scgd	${LINT} -DSTRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
1141.38Scgd	    ${.ALLSRC}
1151.38Scgd.endif
1161.38Scgd
1171.38Scgd# if no machine specific strrchr(3), build one out of rindex(3).
1181.38Scgd.if empty(SRCS:Mstrrchr.S)
1191.38ScgdOBJS+=	strrchr.o
1201.38Scgdstrrchr.o: rindex.c
1211.39Scgd	@echo ${COMPILE.c:Q} -DSTRRCHR ${.ALLSRC} -o ${.TARGET}
1221.39Scgd	@${COMPILE.c} -DSTRRCHR ${.ALLSRC} -o ${.TARGET}.o
1231.39Scgd	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
1241.39Scgd	@rm -f ${.TARGET}.o
1251.38Scgd
1261.38Scgdstrrchr.po: rindex.c
1271.39Scgd	@echo ${COMPILE.c:Q} -DSTRRCHR -pg ${.ALLSRC} -o ${.TARGET}
1281.39Scgd	@${COMPILE.c} -DSTRRCHR -pg ${.ALLSRC} -o ${.TARGET}.o
1291.39Scgd	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
1301.39Scgd	@rm -f ${.TARGET}.o
1311.38Scgd
1321.38Scgdstrrchr.so: rindex.c
1331.39Scgd	@echo ${COMPILE.c:Q} -DSTRRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}
1341.39Scgd	@${COMPILE.c} -DSTRRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o
1351.39Scgd	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
1361.39Scgd	@rm -f ${.TARGET}.o
1371.38Scgd
1381.38ScgdLOBJS+= strrchr.ln
1391.38Scgdstrrchr.ln: rindex.c
1401.38Scgd	${LINT} -DSTRRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
1411.38Scgd	    ${.ALLSRC}
1421.38Scgd.endif
1431.36Scjs
1441.43SdrochnerPOBJS+=	${OBJS:.o=.po} mcount.po
1451.43Sdrochner
1461.36Scjs# only needed during build
1471.36Scjslibinstall::
1481.1Scgd
1491.1Scgd.include <bsd.lib.mk>
1501.23Smycroft
1511.23Smycroftlib${LIB}.o:: ${OBJS}
1521.23Smycroft	@echo building standard ${LIB} library
1531.23Smycroft	@rm -f lib${LIB}.o
1541.37Sgwr	@${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}`
1551.23Smycroft
1561.23Smycroftlib${LIB}.po:: ${POBJS}
1571.23Smycroft	@echo building profiled ${LIB} library
1581.23Smycroft	@rm -f lib${LIB}.po
1591.37Sgwr	@${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}`
160