1 1.59 bjh21 # $NetBSD: Makefile,v 1.59 2001/02/16 16:58:27 bjh21 Exp $ 2 1.1 cgd 3 1.1 cgd LIB= kern 4 1.47 lukem MKPIC= no 5 1.9 deraadt 6 1.59 bjh21 .include <bsd.own.mk> 7 1.59 bjh21 8 1.59 bjh21 .if exists(${KERNDIR}/arch/${MACHINE_ARCH}) 9 1.59 bjh21 ARCHSUBDIR= ${MACHINE_ARCH} 10 1.59 bjh21 .elif exists(${KERNDIR}/arch/${MACHINE_CPU}) 11 1.59 bjh21 ARCHSUBDIR= ${MACHINE_CPU} 12 1.59 bjh21 .else 13 1.59 bjh21 .BEGIN: 14 1.59 bjh21 @echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU} 15 1.59 bjh21 @false 16 1.59 bjh21 .endif 17 1.59 bjh21 18 1.52 drochner M= ${KERNDIR}/arch/${ARCHSUBDIR} 19 1.20 christos 20 1.32 cgd CPPFLAGS= -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS} 21 1.29 mycroft 22 1.52 drochner .PATH.c: ${KERNDIR} 23 1.29 mycroft .if exists ($M/Makefile.inc) 24 1.52 drochner .PATH.c: $M 25 1.52 drochner .PATH.S: $M 26 1.29 mycroft .include "$M/Makefile.inc" 27 1.1 cgd .endif 28 1.5 cgd 29 1.19 cgd .if (${MACHINE_ARCH} != "alpha") 30 1.5 cgd # Quad support 31 1.5 cgd SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 32 1.5 cgd lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 33 1.5 cgd subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 34 1.19 cgd .endif 35 1.8 cgd 36 1.8 cgd # Other stuff 37 1.55 deberg SRCS+= __cmsg_alignbytes.c inet_addr.c intoa.c md4c.c md5c.c sha1.c pmatch.c 38 1.27 scottr 39 1.27 scottr # Files to clean up 40 1.27 scottr CLEANFILES+= lib${LIB}.o lib${LIB}.po 41 1.5 cgd 42 1.38 cgd # 43 1.38 cgd # Special rules for certain objects 44 1.38 cgd # 45 1.38 cgd 46 1.11 cgd # mcount cannot be compiled with profiling 47 1.11 cgd mcount.po: mcount.o 48 1.11 cgd cp mcount.o mcount.po 49 1.40 mycroft 50 1.46 perry # XXX these stub builds should be cleaned up even further. 51 1.46 perry 52 1.46 perry # if no machine specific memcpy(3), build one out of bcopy(3) based stub. 53 1.40 mycroft .if empty(SRCS:Mmemcpy.S) 54 1.46 perry SRCS+= memcpy.c 55 1.44 perry .endif 56 1.44 perry 57 1.46 perry # if no machine specific memmove(3), build one out of bcopy(3) based stub. 58 1.44 perry .if empty(SRCS:Mmemmove.S) 59 1.46 perry SRCS+= memmove.c 60 1.40 mycroft .endif 61 1.38 cgd 62 1.46 perry # if no machine specific strchr(3), build one out of index(3) based stub. 63 1.38 cgd .if empty(SRCS:Mstrchr.S) 64 1.46 perry SRCS+= strchr.c 65 1.38 cgd .endif 66 1.38 cgd 67 1.46 perry # if no machine specific strrchr(3), build one out of rindex(3) based stub. 68 1.38 cgd .if empty(SRCS:Mstrrchr.S) 69 1.46 perry SRCS+= strrchr.c 70 1.38 cgd .endif 71 1.36 cjs 72 1.48 chs POBJS+= mcount.po 73 1.43 drochner 74 1.36 cjs # only needed during build 75 1.36 cjs libinstall:: 76 1.1 cgd 77 1.1 cgd .include <bsd.lib.mk> 78 1.23 mycroft 79 1.23 mycroft lib${LIB}.o:: ${OBJS} 80 1.23 mycroft @echo building standard ${LIB} library 81 1.23 mycroft @rm -f lib${LIB}.o 82 1.37 gwr @${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}` 83 1.23 mycroft 84 1.23 mycroft lib${LIB}.po:: ${POBJS} 85 1.23 mycroft @echo building profiled ${LIB} library 86 1.23 mycroft @rm -f lib${LIB}.po 87 1.37 gwr @${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}` 88