Makefile revision 1.66
11.66Sjunyoung#	$NetBSD: Makefile,v 1.66 2002/10/04 18:39:52 junyoung 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.66Sjunyoung
421.66Sjunyoung.if (${MACHINE_ARCH} == "i386")
431.66SjunyoungSRCS+=	strstr.c
441.66Sjunyoung.endif
451.27Sscottr
461.27Sscottr# Files to clean up
471.27SscottrCLEANFILES+= lib${LIB}.o lib${LIB}.po
481.5Scgd
491.38Scgd#
501.38Scgd# Special rules for certain objects
511.38Scgd#
521.38Scgd
531.11Scgd# mcount cannot be compiled with profiling
541.11Scgdmcount.po: mcount.o
551.11Scgd	cp mcount.o mcount.po
561.40Smycroft
571.46Sperry# XXX these stub builds should be cleaned up even further.
581.46Sperry
591.46Sperry# if no machine specific memcpy(3), build one out of bcopy(3) based stub.
601.40Smycroft.if empty(SRCS:Mmemcpy.S)
611.46SperrySRCS+=	memcpy.c
621.44Sperry.endif
631.44Sperry
641.46Sperry# if no machine specific memmove(3), build one out of bcopy(3) based stub.
651.44Sperry.if empty(SRCS:Mmemmove.S)
661.46SperrySRCS+=	memmove.c
671.40Smycroft.endif
681.38Scgd
691.46Sperry# if no machine specific strchr(3), build one out of index(3) based stub.
701.38Scgd.if empty(SRCS:Mstrchr.S)
711.46SperrySRCS+=	strchr.c
721.38Scgd.endif
731.38Scgd
741.46Sperry# if no machine specific strrchr(3), build one out of rindex(3) based stub.
751.38Scgd.if empty(SRCS:Mstrrchr.S)
761.46SperrySRCS+=	strrchr.c
771.38Scgd.endif
781.36Scjs
791.48SchsPOBJS+=	mcount.po
801.43Sdrochner
811.36Scjs# only needed during build
821.36Scjslibinstall::
831.1Scgd
841.62Stv.undef DESTDIR
851.1Scgd.include <bsd.lib.mk>
861.23Smycroft
871.23Smycroftlib${LIB}.o:: ${OBJS}
881.23Smycroft	@echo building standard ${LIB} library
891.23Smycroft	@rm -f lib${LIB}.o
901.37Sgwr	@${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}`
911.23Smycroft
921.23Smycroftlib${LIB}.po:: ${POBJS}
931.23Smycroft	@echo building profiled ${LIB} library
941.23Smycroft	@rm -f lib${LIB}.po
951.37Sgwr	@${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}`
961.65Swrstuden
971.65Swrstudenshowsources: ${SRCS}
981.65Swrstuden	@echo ${.ALLSRC}
99