Home | History | Annotate | Line # | Download | only in libkern
Makefile revision 1.38
      1 #	$NetBSD: Makefile,v 1.38 1998/01/21 21:23:18 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 	${COMPILE.c} -DSTRCHR ${.ALLSRC} -o ${.TARGET}
     41 	@${LD} -x -r ${.TARGET}
     42 	@mv a.out ${.TARGET}
     43 
     44 strchr.po: index.c
     45 	${COMPILE.c} -DSTRCHR -p ${.ALLSRC} -o ${.TARGET}
     46 	@${LD} -X -r ${.TARGET}
     47 	@mv a.out ${.TARGET}
     48 
     49 strchr.so: index.c
     50 	${COMPILE.c} ${PICFLAG} -DPIC -DSTRCHR ${.ALLSRC} -o ${.TARGET}
     51 
     52 LOBJS+= strchr.ln
     53 strchr.ln: index.c
     54 	${LINT} -DSTRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
     55 	    ${.ALLSRC}
     56 .endif
     57 
     58 # if no machine specific strrchr(3), build one out of rindex(3).
     59 .if empty(SRCS:Mstrrchr.S)
     60 OBJS+=	strrchr.o
     61 strrchr.o: rindex.c
     62 	${COMPILE.c} -DSTRRCHR ${.ALLSRC} -o ${.TARGET}
     63 	@${LD} -x -r ${.TARGET}
     64 	@mv a.out ${.TARGET}
     65 
     66 strrchr.po: rindex.c
     67 	${COMPILE.c} -DSTRRCHR -p ${.ALLSRC} -o ${.TARGET}
     68 	@${LD} -X -r ${.TARGET}
     69 	@mv a.out ${.TARGET}
     70 
     71 strrchr.so: rindex.c
     72 	${COMPILE.c} ${PICFLAG} -DPIC -DSTRRCHR ${.ALLSRC} -o ${.TARGET}
     73 
     74 LOBJS+= strrchr.ln
     75 strrchr.ln: rindex.c
     76 	${LINT} -DSTRRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
     77 	    ${.ALLSRC}
     78 .endif
     79 
     80 # only needed during build
     81 libinstall::
     82 
     83 .include <bsd.lib.mk>
     84 
     85 lib${LIB}.o:: ${OBJS}
     86 	@echo building standard ${LIB} library
     87 	@rm -f lib${LIB}.o
     88 	@${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}`
     89 
     90 POBJS+=	${OBJS:.o=.po} mcount.po
     91 lib${LIB}.po:: ${POBJS}
     92 	@echo building profiled ${LIB} library
     93 	@rm -f lib${LIB}.po
     94 	@${LD} -r -o lib${LIB}.po `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}`
     95