Makefile revision 1.68
11.68Sperry#	$NetBSD: Makefile,v 1.68 2002/11/02 07:46:42 perry Exp $
21.1Scgd
31.68SperryLIB=		kern
41.68SperryNOPIC=		# defined
51.68SperryLLIBS=		# defined
61.9Sderaadt
71.59Sbjh21.include <bsd.own.mk>
81.59Sbjh21
91.60Senami.if defined(MACHINE_ARCH) && !empty(MACHINE_ARCH) && \
101.60Senami    exists(${KERNDIR}/arch/${MACHINE_ARCH})
111.59Sbjh21ARCHSUBDIR=     ${MACHINE_ARCH}
121.60Senami.elif defined(MACHINE_CPU) && !empty(MACHINE_CPU) && \
131.60Senami    exists(${KERNDIR}/arch/${MACHINE_CPU}) 
141.59Sbjh21ARCHSUBDIR=     ${MACHINE_CPU}
151.59Sbjh21.else
161.59Sbjh21.BEGIN:
171.60Senami	@echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
181.60Senami	@false
191.59Sbjh21.endif
201.59Sbjh21
211.52SdrochnerM= ${KERNDIR}/arch/${ARCHSUBDIR}
221.20Schristos
231.32ScgdCPPFLAGS=	-I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS}
241.29Smycroft
251.52Sdrochner.PATH.c: ${KERNDIR}
261.29Smycroft.if exists ($M/Makefile.inc)
271.52Sdrochner.PATH.c: $M
281.52Sdrochner.PATH.S: $M
291.29Smycroft.include "$M/Makefile.inc"
301.1Scgd.endif
311.5Scgd
321.19Scgd.if (${MACHINE_ARCH} != "alpha")
331.5Scgd# Quad support
341.5ScgdSRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
351.5Scgd	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
361.5Scgd	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
371.19Scgd.endif
381.8Scgd
391.8Scgd# Other stuff
401.55SdebergSRCS+=	__cmsg_alignbytes.c inet_addr.c intoa.c md4c.c md5c.c sha1.c pmatch.c
411.64SitojunSRCS+=	_que.c arc4random.c
421.66Sjunyoung
431.66SjunyoungSRCS+=	strstr.c
441.27Sscottr
451.27Sscottr# Files to clean up
461.27SscottrCLEANFILES+= lib${LIB}.o lib${LIB}.po
471.5Scgd
481.38Scgd#
491.38Scgd# Special rules for certain objects
501.38Scgd#
511.38Scgd
521.11Scgd# mcount cannot be compiled with profiling
531.11Scgdmcount.po: mcount.o
541.11Scgd	cp mcount.o mcount.po
551.40Smycroft
561.46Sperry# XXX these stub builds should be cleaned up even further.
571.46Sperry
581.46Sperry# if no machine specific memcpy(3), build one out of bcopy(3) based stub.
591.40Smycroft.if empty(SRCS:Mmemcpy.S)
601.46SperrySRCS+=	memcpy.c
611.44Sperry.endif
621.44Sperry
631.46Sperry# if no machine specific memmove(3), build one out of bcopy(3) based stub.
641.44Sperry.if empty(SRCS:Mmemmove.S)
651.46SperrySRCS+=	memmove.c
661.40Smycroft.endif
671.38Scgd
681.46Sperry# if no machine specific strchr(3), build one out of index(3) based stub.
691.38Scgd.if empty(SRCS:Mstrchr.S)
701.46SperrySRCS+=	strchr.c
711.38Scgd.endif
721.38Scgd
731.46Sperry# if no machine specific strrchr(3), build one out of rindex(3) based stub.
741.38Scgd.if empty(SRCS:Mstrrchr.S)
751.46SperrySRCS+=	strrchr.c
761.38Scgd.endif
771.36Scjs
781.48SchsPOBJS+=	mcount.po
791.43Sdrochner
801.36Scjs# only needed during build
811.36Scjslibinstall::
821.1Scgd
831.62Stv.undef DESTDIR
841.1Scgd.include <bsd.lib.mk>
851.23Smycroft
861.23Smycroftlib${LIB}.o:: ${OBJS}
871.23Smycroft	@echo building standard ${LIB} library
881.23Smycroft	@rm -f lib${LIB}.o
891.37Sgwr	@${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}`
901.23Smycroft
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}`
951.65Swrstuden
961.65Swrstudenshowsources: ${SRCS}
971.65Swrstuden	@echo ${.ALLSRC}
98