1 1.2.2.3 yamt # $NetBSD: Makefile.libkern,v 1.2.2.3 2009/06/20 07:20:32 yamt Exp $ 2 1.2.2.2 yamt 3 1.2.2.2 yamt # 4 1.2.2.2 yamt # Variable definitions for libkern. 5 1.2.2.2 yamt # 6 1.2.2.2 yamt # Before including this, you _must_ set 7 1.2.2.2 yamt # KERNDIR: location of sys/lib/libkern 8 1.2.2.2 yamt # 9 1.2.2.2 yamt # You *may* set: 10 1.2.2.2 yamt # LIBKERN_ARCH: architecture subdir to be used 11 1.2.2.2 yamt # KERNCPPFLAGS: see Makefile.inc 12 1.2.2.2 yamt # KERNMICPPFLAGS: see Makefile.inc 13 1.2.2.2 yamt # 14 1.2.2.2 yamt 15 1.2.2.2 yamt .include <bsd.own.mk> 16 1.2.2.2 yamt 17 1.2.2.2 yamt .if defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \ 18 1.2.2.2 yamt exists(${KERNDIR}/arch/${LIBKERN_ARCH}) 19 1.2.2.2 yamt ARCHSUBDIR= ${LIBKERN_ARCH} 20 1.2.2.2 yamt .elif defined(MACHINE_ARCH) && !empty(MACHINE_ARCH) && \ 21 1.2.2.2 yamt exists(${KERNDIR}/arch/${MACHINE_ARCH}) 22 1.2.2.2 yamt ARCHSUBDIR= ${MACHINE_ARCH} 23 1.2.2.2 yamt .elif defined(MACHINE_CPU) && !empty(MACHINE_CPU) && \ 24 1.2.2.2 yamt exists(${KERNDIR}/arch/${MACHINE_CPU}) 25 1.2.2.2 yamt ARCHSUBDIR= ${MACHINE_CPU} 26 1.2.2.2 yamt .endif 27 1.2.2.2 yamt 28 1.2.2.2 yamt M= ${KERNDIR}/arch/${ARCHSUBDIR} 29 1.2.2.2 yamt 30 1.2.2.2 yamt CPPFLAGS+= -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS} 31 1.2.2.2 yamt 32 1.2.2.2 yamt .include "${.PARSEDIR}/../../../common/lib/libc/Makefile.inc" 33 1.2.2.2 yamt .include "${.PARSEDIR}/../../../common/lib/libutil/Makefile.inc" 34 1.2.2.2 yamt .include "${.PARSEDIR}/../../../common/lib/libprop/Makefile.inc" 35 1.2.2.2 yamt 36 1.2.2.2 yamt CPPFLAGS+= -I${KERNDIR}/../../../common/include 37 1.2.2.2 yamt 38 1.2.2.2 yamt .PATH.c: ${KERNDIR} 39 1.2.2.2 yamt .if exists ($M/Makefile.inc) 40 1.2.2.2 yamt .PATH.c: $M 41 1.2.2.2 yamt .PATH.S: $M 42 1.2.2.2 yamt .include "$M/Makefile.inc" 43 1.2.2.2 yamt .endif 44 1.2.2.2 yamt 45 1.2.2.2 yamt .if (${MACHINE_ARCH} != "alpha") 46 1.2.2.2 yamt # Quad support 47 1.2.2.2 yamt SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 48 1.2.2.2 yamt lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 49 1.2.2.2 yamt subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 50 1.2.2.2 yamt .endif 51 1.2.2.2 yamt 52 1.2.2.2 yamt # Other stuff 53 1.2.2.2 yamt SRCS+= __cmsg_alignbytes.c cpuset.c inet_addr.c intoa.c 54 1.2.2.2 yamt SRCS+= md4c.c md5c.c rmd160.c sha1.c sha2.c 55 1.2.2.2 yamt SRCS+= pmatch.c arc4random.c bcd.c mcount.c mertwist.c crc32.c 56 1.2.2.2 yamt 57 1.2.2.2 yamt SRCS+= strsep.c strstr.c strlcpy.c strlcat.c 58 1.2.2.2 yamt 59 1.2.2.2 yamt SRCS+= strtoll.c strtoull.c strtoumax.c 60 1.2.2.2 yamt 61 1.2.2.2 yamt SRCS+= xlat_mbr_fstype.c 62 1.2.2.2 yamt 63 1.2.2.3 yamt SRCS+= heapsort.c ptree.c rb.c rpst.c 64 1.2.2.2 yamt 65 1.2.2.2 yamt # Files to clean up 66 1.2.2.2 yamt CLEANFILES+= lib${LIB}.o lib${LIB}.po 67 1.2.2.2 yamt 68 1.2.2.2 yamt # XXX these stub builds should be cleaned up even further. 69 1.2.2.2 yamt 70 1.2.2.2 yamt # if no machine specific memcpy(3), build one out of bcopy(3) based stub. 71 1.2.2.2 yamt .if empty(SRCS:Mmemcpy.S) 72 1.2.2.2 yamt SRCS+= memcpy.c 73 1.2.2.2 yamt .endif 74 1.2.2.2 yamt 75 1.2.2.2 yamt # if no machine specific memmove(3), build one out of bcopy(3) based stub. 76 1.2.2.2 yamt .if empty(SRCS:Mmemmove.S) 77 1.2.2.2 yamt SRCS+= memmove.c 78 1.2.2.2 yamt .endif 79 1.2.2.2 yamt 80 1.2.2.2 yamt # if no machine specific strchr(3), build one out of index(3) based stub. 81 1.2.2.2 yamt .if empty(SRCS:Mstrchr.S) 82 1.2.2.2 yamt SRCS+= strchr.c 83 1.2.2.2 yamt .endif 84 1.2.2.2 yamt 85 1.2.2.2 yamt # if no machine specific strrchr(3), build one out of rindex(3) based stub. 86 1.2.2.2 yamt .if empty(SRCS:Mstrrchr.S) 87 1.2.2.2 yamt SRCS+= strrchr.c 88 1.2.2.2 yamt .endif 89