1# $NetBSD: Makefile,v 1.55 2000/12/08 06:30:21 deberg Exp $ 2 3LIB= kern 4MKPIC= no 5 6ARCHSUBDIR= ${MACHINE_ARCH:C/mipse[bl]/mips/} 7M= ${KERNDIR}/arch/${ARCHSUBDIR} 8 9CPPFLAGS= -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS} 10 11.PATH.c: ${KERNDIR} 12.if exists ($M/Makefile.inc) 13.PATH.c: $M 14.PATH.S: $M 15.include "$M/Makefile.inc" 16.endif 17 18.if (${MACHINE_ARCH} != "alpha") 19# Quad support 20SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 21 lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 22 subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 23.endif 24 25# Other stuff 26SRCS+= __cmsg_alignbytes.c inet_addr.c intoa.c md4c.c md5c.c sha1.c pmatch.c 27 28# Files to clean up 29CLEANFILES+= lib${LIB}.o lib${LIB}.po 30 31# 32# Special rules for certain objects 33# 34 35# mcount cannot be compiled with profiling 36mcount.po: mcount.o 37 cp mcount.o mcount.po 38 39# XXX these stub builds should be cleaned up even further. 40 41# if no machine specific memcpy(3), build one out of bcopy(3) based stub. 42.if empty(SRCS:Mmemcpy.S) 43SRCS+= memcpy.c 44.endif 45 46# if no machine specific memmove(3), build one out of bcopy(3) based stub. 47.if empty(SRCS:Mmemmove.S) 48SRCS+= memmove.c 49.endif 50 51# if no machine specific strchr(3), build one out of index(3) based stub. 52.if empty(SRCS:Mstrchr.S) 53SRCS+= strchr.c 54.endif 55 56# if no machine specific strrchr(3), build one out of rindex(3) based stub. 57.if empty(SRCS:Mstrrchr.S) 58SRCS+= strrchr.c 59.endif 60 61POBJS+= mcount.po 62 63# only needed during build 64libinstall:: 65 66.include <bsd.lib.mk> 67 68lib${LIB}.o:: ${OBJS} 69 @echo building standard ${LIB} library 70 @rm -f lib${LIB}.o 71 @${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}` 72 73lib${LIB}.po:: ${POBJS} 74 @echo building profiled ${LIB} library 75 @rm -f lib${LIB}.po 76 @${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}` 77