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