1 # $NetBSD: Makefile,v 1.39 1998/01/23 19:01:17 cgd Exp $ 2 3 LIB= kern 4 NOPIC= 5 6 M= ${.CURDIR}/arch/${MACHINE_ARCH} 7 8 CPPFLAGS= -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS} 9 10 .if exists ($M/Makefile.inc) 11 .PATH: $M 12 .include "$M/Makefile.inc" 13 .endif 14 15 .if (${MACHINE_ARCH} != "alpha") 16 # Quad support 17 SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 18 lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 19 subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 20 .endif 21 22 # Other stuff 23 SRCS+= md5c.c 24 25 # Files to clean up 26 CLEANFILES+= lib${LIB}.o lib${LIB}.po 27 28 # 29 # Special rules for certain objects 30 # 31 32 # mcount cannot be compiled with profiling 33 mcount.po: mcount.o 34 cp mcount.o mcount.po 35 36 # if no machine specific strchr(3), build one out of index(3). 37 .if empty(SRCS:Mstrchr.S) 38 OBJS+= strchr.o 39 strchr.o: index.c 40 @echo ${COMPILE.c:Q} -DSTRCHR ${.ALLSRC} -o ${.TARGET} 41 @${COMPILE.c} -DSTRCHR ${.ALLSRC} -o ${.TARGET}.o 42 @${LD} -x -r ${.TARGET}.o -o ${.TARGET} 43 @rm -f ${.TARGET}.o 44 45 strchr.po: index.c 46 @echo ${COMPILE.c:Q} -DSTRCHR -pg ${.ALLSRC} -o ${.TARGET} 47 @${COMPILE.c} -DSTRCHR -pg ${.ALLSRC} -o ${.TARGET}.o 48 @${LD} -X -r ${.TARGET}.o -o ${.TARGET} 49 @rm -f ${.TARGET}.o 50 51 strchr.so: index.c 52 @echo ${COMPILE.c:Q} -DSTRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET} 53 @${COMPILE.c} -DSTRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o 54 @${LD} -x -r ${.TARGET}.o -o ${.TARGET} 55 @rm -f ${.TARGET}.o 56 57 LOBJS+= strchr.ln 58 strchr.ln: index.c 59 ${LINT} -DSTRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \ 60 ${.ALLSRC} 61 .endif 62 63 # if no machine specific strrchr(3), build one out of rindex(3). 64 .if empty(SRCS:Mstrrchr.S) 65 OBJS+= strrchr.o 66 strrchr.o: rindex.c 67 @echo ${COMPILE.c:Q} -DSTRRCHR ${.ALLSRC} -o ${.TARGET} 68 @${COMPILE.c} -DSTRRCHR ${.ALLSRC} -o ${.TARGET}.o 69 @${LD} -x -r ${.TARGET}.o -o ${.TARGET} 70 @rm -f ${.TARGET}.o 71 72 strrchr.po: rindex.c 73 @echo ${COMPILE.c:Q} -DSTRRCHR -pg ${.ALLSRC} -o ${.TARGET} 74 @${COMPILE.c} -DSTRRCHR -pg ${.ALLSRC} -o ${.TARGET}.o 75 @${LD} -X -r ${.TARGET}.o -o ${.TARGET} 76 @rm -f ${.TARGET}.o 77 78 strrchr.so: rindex.c 79 @echo ${COMPILE.c:Q} -DSTRRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET} 80 @${COMPILE.c} -DSTRRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o 81 @${LD} -x -r ${.TARGET}.o -o ${.TARGET} 82 @rm -f ${.TARGET}.o 83 84 LOBJS+= strrchr.ln 85 strrchr.ln: rindex.c 86 ${LINT} -DSTRRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \ 87 ${.ALLSRC} 88 .endif 89 90 # only needed during build 91 libinstall:: 92 93 .include <bsd.lib.mk> 94 95 lib${LIB}.o:: ${OBJS} 96 @echo building standard ${LIB} library 97 @rm -f lib${LIB}.o 98 @${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}` 99 100 POBJS+= ${OBJS:.o=.po} mcount.po 101 lib${LIB}.po:: ${POBJS} 102 @echo building profiled ${LIB} library 103 @rm -f lib${LIB}.po 104 @${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}` 105