Makefile revision 1.59
11.59Sbjh21#	$NetBSD: Makefile,v 1.59 2001/02/16 16:58:27 bjh21 Exp $
21.1Scgd
31.1ScgdLIB=	kern
41.47SlukemMKPIC=	no
51.9Sderaadt
61.59Sbjh21.include <bsd.own.mk>
71.59Sbjh21
81.59Sbjh21.if exists(${KERNDIR}/arch/${MACHINE_ARCH})
91.59Sbjh21ARCHSUBDIR=     ${MACHINE_ARCH}
101.59Sbjh21.elif exists(${KERNDIR}/arch/${MACHINE_CPU}) 
111.59Sbjh21ARCHSUBDIR=     ${MACHINE_CPU}
121.59Sbjh21.else
131.59Sbjh21.BEGIN:
141.59Sbjh21        @echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
151.59Sbjh21        @false
161.59Sbjh21.endif
171.59Sbjh21
181.52SdrochnerM= ${KERNDIR}/arch/${ARCHSUBDIR}
191.20Schristos
201.32ScgdCPPFLAGS=	-I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS}
211.29Smycroft
221.52Sdrochner.PATH.c: ${KERNDIR}
231.29Smycroft.if exists ($M/Makefile.inc)
241.52Sdrochner.PATH.c: $M
251.52Sdrochner.PATH.S: $M
261.29Smycroft.include "$M/Makefile.inc"
271.1Scgd.endif
281.5Scgd
291.19Scgd.if (${MACHINE_ARCH} != "alpha")
301.5Scgd# Quad support
311.5ScgdSRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
321.5Scgd	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
331.5Scgd	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
341.19Scgd.endif
351.8Scgd
361.8Scgd# Other stuff
371.55SdebergSRCS+=	__cmsg_alignbytes.c inet_addr.c intoa.c md4c.c md5c.c sha1.c pmatch.c
381.27Sscottr
391.27Sscottr# Files to clean up
401.27SscottrCLEANFILES+= lib${LIB}.o lib${LIB}.po
411.5Scgd
421.38Scgd#
431.38Scgd# Special rules for certain objects
441.38Scgd#
451.38Scgd
461.11Scgd# mcount cannot be compiled with profiling
471.11Scgdmcount.po: mcount.o
481.11Scgd	cp mcount.o mcount.po
491.40Smycroft
501.46Sperry# XXX these stub builds should be cleaned up even further.
511.46Sperry
521.46Sperry# if no machine specific memcpy(3), build one out of bcopy(3) based stub.
531.40Smycroft.if empty(SRCS:Mmemcpy.S)
541.46SperrySRCS+=	memcpy.c
551.44Sperry.endif
561.44Sperry
571.46Sperry# if no machine specific memmove(3), build one out of bcopy(3) based stub.
581.44Sperry.if empty(SRCS:Mmemmove.S)
591.46SperrySRCS+=	memmove.c
601.40Smycroft.endif
611.38Scgd
621.46Sperry# if no machine specific strchr(3), build one out of index(3) based stub.
631.38Scgd.if empty(SRCS:Mstrchr.S)
641.46SperrySRCS+=	strchr.c
651.38Scgd.endif
661.38Scgd
671.46Sperry# if no machine specific strrchr(3), build one out of rindex(3) based stub.
681.38Scgd.if empty(SRCS:Mstrrchr.S)
691.46SperrySRCS+=	strrchr.c
701.38Scgd.endif
711.36Scjs
721.48SchsPOBJS+=	mcount.po
731.43Sdrochner
741.36Scjs# only needed during build
751.36Scjslibinstall::
761.1Scgd
771.1Scgd.include <bsd.lib.mk>
781.23Smycroft
791.23Smycroftlib${LIB}.o:: ${OBJS}
801.23Smycroft	@echo building standard ${LIB} library
811.23Smycroft	@rm -f lib${LIB}.o
821.37Sgwr	@${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}`
831.23Smycroft
841.23Smycroftlib${LIB}.po:: ${POBJS}
851.23Smycroft	@echo building profiled ${LIB} library
861.23Smycroft	@rm -f lib${LIB}.po
871.37Sgwr	@${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}`
88