Home | History | Annotate | Line # | Download | only in libkern
Makefile revision 1.77.10.2
      1 #	$NetBSD: Makefile,v 1.77.10.2 2006/05/11 23:31:08 elad Exp $
      2 
      3 LIB=		kern
      4 NOPIC=		# defined
      5 LLIBS=		# defined
      6 
      7 .include <bsd.own.mk>
      8 
      9 .if defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \
     10     exists(${KERNDIR}/arch/${LIBKERN_ARCH})
     11 ARCHSUBDIR=     ${LIBKERN_ARCH}
     12 .elif defined(MACHINE_ARCH) && !empty(MACHINE_ARCH) && \
     13     exists(${KERNDIR}/arch/${MACHINE_ARCH})
     14 ARCHSUBDIR=     ${MACHINE_ARCH}
     15 .elif defined(MACHINE_CPU) && !empty(MACHINE_CPU) && \
     16     exists(${KERNDIR}/arch/${MACHINE_CPU})
     17 ARCHSUBDIR=     ${MACHINE_CPU}
     18 .else
     19 .BEGIN:
     20 	@echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
     21 	@false
     22 .endif
     23 
     24 M= ${KERNDIR}/arch/${ARCHSUBDIR}
     25 
     26 CPPFLAGS=	-I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS}
     27 
     28 .include "${.PARSEDIR}/../../../common/lib/libc/Makefile.inc"
     29 .include "${.PARSEDIR}/../../../common/lib/libprop/Makefile.inc"
     30 
     31 .PATH.c: ${KERNDIR}
     32 .if exists ($M/Makefile.inc)
     33 .PATH.c: $M
     34 .PATH.S: $M
     35 .include "$M/Makefile.inc"
     36 .endif
     37 
     38 .if (${MACHINE_ARCH} != "alpha")
     39 # Quad support
     40 SRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
     41 	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
     42 	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
     43 .endif
     44 
     45 # Other stuff
     46 SRCS+=	__cmsg_alignbytes.c inet_addr.c intoa.c md4c.c md5c.c sha1.c pmatch.c
     47 SRCS+=	_que.c arc4random.c bcd.c mcount.c
     48 
     49 SRCS+=	strstr.c strlcpy.c strlcat.c
     50 
     51 SRCS+=	strtoumax.c
     52 
     53 SRCS+=	xlat_mbr_fstype.c
     54 
     55 # Files to clean up
     56 CLEANFILES+= lib${LIB}.o lib${LIB}.po
     57 
     58 # XXX these stub builds should be cleaned up even further.
     59 
     60 # if no machine specific memcpy(3), build one out of bcopy(3) based stub.
     61 .if empty(SRCS:Mmemcpy.S)
     62 SRCS+=	memcpy.c
     63 .endif
     64 
     65 # if no machine specific memmove(3), build one out of bcopy(3) based stub.
     66 .if empty(SRCS:Mmemmove.S)
     67 SRCS+=	memmove.c
     68 .endif
     69 
     70 # if no machine specific strchr(3), build one out of index(3) based stub.
     71 .if empty(SRCS:Mstrchr.S)
     72 SRCS+=	strchr.c
     73 .endif
     74 
     75 # if no machine specific strrchr(3), build one out of rindex(3) based stub.
     76 .if empty(SRCS:Mstrrchr.S)
     77 SRCS+=	strrchr.c
     78 .endif
     79 
     80 # only needed during build
     81 libinstall::
     82 
     83 .undef DESTDIR
     84 .include <bsd.lib.mk>
     85 
     86 lib${LIB}.o:: ${OBJS}
     87 	@echo building standard ${LIB} library
     88 	@rm -f lib${LIB}.o
     89 	@${LD} -r -o lib${LIB}.o `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}`
     90 
     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 
     96 showsources: ${SRCS}
     97 	@echo ${.ALLSRC}
     98