Makefile revision 1.64
11.64Sitojun#	$NetBSD: Makefile,v 1.64 2002/05/28 10:09:24 itojun Exp $
21.1Scgd
31.1ScgdLIB=	kern
41.63StvNOPIC=	# defined
51.9Sderaadt
61.59Sbjh21.include <bsd.own.mk>
71.59Sbjh21
81.60Senami.if defined(MACHINE_ARCH) && !empty(MACHINE_ARCH) && \
91.60Senami    exists(${KERNDIR}/arch/${MACHINE_ARCH})
101.59Sbjh21ARCHSUBDIR=     ${MACHINE_ARCH}
111.60Senami.elif defined(MACHINE_CPU) && !empty(MACHINE_CPU) && \
121.60Senami    exists(${KERNDIR}/arch/${MACHINE_CPU}) 
131.59Sbjh21ARCHSUBDIR=     ${MACHINE_CPU}
141.59Sbjh21.else
151.59Sbjh21.BEGIN:
161.60Senami	@echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
171.60Senami	@false
181.59Sbjh21.endif
191.59Sbjh21
201.52SdrochnerM= ${KERNDIR}/arch/${ARCHSUBDIR}
211.20Schristos
221.32ScgdCPPFLAGS=	-I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS}
231.29Smycroft
241.52Sdrochner.PATH.c: ${KERNDIR}
251.29Smycroft.if exists ($M/Makefile.inc)
261.52Sdrochner.PATH.c: $M
271.52Sdrochner.PATH.S: $M
281.29Smycroft.include "$M/Makefile.inc"
291.1Scgd.endif
301.5Scgd
311.19Scgd.if (${MACHINE_ARCH} != "alpha")
321.5Scgd# Quad support
331.5ScgdSRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
341.5Scgd	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
351.5Scgd	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
361.19Scgd.endif
371.8Scgd
381.8Scgd# Other stuff
391.55SdebergSRCS+=	__cmsg_alignbytes.c inet_addr.c intoa.c md4c.c md5c.c sha1.c pmatch.c
401.64SitojunSRCS+=	_que.c arc4random.c
411.27Sscottr
421.27Sscottr# Files to clean up
431.27SscottrCLEANFILES+= lib${LIB}.o lib${LIB}.po
441.5Scgd
451.38Scgd#
461.38Scgd# Special rules for certain objects
471.38Scgd#
481.38Scgd
491.11Scgd# mcount cannot be compiled with profiling
501.11Scgdmcount.po: mcount.o
511.11Scgd	cp mcount.o mcount.po
521.40Smycroft
531.46Sperry# XXX these stub builds should be cleaned up even further.
541.46Sperry
551.46Sperry# if no machine specific memcpy(3), build one out of bcopy(3) based stub.
561.40Smycroft.if empty(SRCS:Mmemcpy.S)
571.46SperrySRCS+=	memcpy.c
581.44Sperry.endif
591.44Sperry
601.46Sperry# if no machine specific memmove(3), build one out of bcopy(3) based stub.
611.44Sperry.if empty(SRCS:Mmemmove.S)
621.46SperrySRCS+=	memmove.c
631.40Smycroft.endif
641.38Scgd
651.46Sperry# if no machine specific strchr(3), build one out of index(3) based stub.
661.38Scgd.if empty(SRCS:Mstrchr.S)
671.46SperrySRCS+=	strchr.c
681.38Scgd.endif
691.38Scgd
701.46Sperry# if no machine specific strrchr(3), build one out of rindex(3) based stub.
711.38Scgd.if empty(SRCS:Mstrrchr.S)
721.46SperrySRCS+=	strrchr.c
731.38Scgd.endif
741.36Scjs
751.48SchsPOBJS+=	mcount.po
761.43Sdrochner
771.36Scjs# only needed during build
781.36Scjslibinstall::
791.1Scgd
801.62Stv.undef DESTDIR
811.1Scgd.include <bsd.lib.mk>
821.23Smycroft
831.23Smycroftlib${LIB}.o:: ${OBJS}
841.23Smycroft	@echo building standard ${LIB} library
851.23Smycroft	@rm -f lib${LIB}.o
861.37Sgwr	@${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}`
871.23Smycroft
881.23Smycroftlib${LIB}.po:: ${POBJS}
891.23Smycroft	@echo building profiled ${LIB} library
901.23Smycroft	@rm -f lib${LIB}.po
911.37Sgwr	@${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}`
92