1 # $NetBSD: Makefile.libkern,v 1.5 2009/08/14 19:23:53 dsl Exp $ 2 3 # 4 # Variable definitions for libkern. 5 # 6 # Before including this, you _must_ set 7 # KERNDIR: location of sys/lib/libkern 8 # 9 # You *may* set: 10 # LIBKERN_ARCH: architecture subdir to be used 11 # KERNCPPFLAGS: see Makefile.inc 12 # KERNMICPPFLAGS: see Makefile.inc 13 # 14 15 .include <bsd.own.mk> 16 17 .if defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \ 18 exists(${KERNDIR}/arch/${LIBKERN_ARCH}) 19 ARCHSUBDIR= ${LIBKERN_ARCH} 20 .elif defined(MACHINE_ARCH) && !empty(MACHINE_ARCH) && \ 21 exists(${KERNDIR}/arch/${MACHINE_ARCH}) 22 ARCHSUBDIR= ${MACHINE_ARCH} 23 .elif defined(MACHINE_CPU) && !empty(MACHINE_CPU) && \ 24 exists(${KERNDIR}/arch/${MACHINE_CPU}) 25 ARCHSUBDIR= ${MACHINE_CPU} 26 .endif 27 28 M= ${KERNDIR}/arch/${ARCHSUBDIR} 29 30 CPPFLAGS+= -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS} 31 32 .include "${.PARSEDIR}/../../../common/lib/libc/Makefile.inc" 33 .include "${.PARSEDIR}/../../../common/lib/libutil/Makefile.inc" 34 .include "${.PARSEDIR}/../../../common/lib/libprop/Makefile.inc" 35 36 CPPFLAGS+= -I${KERNDIR}/../../../common/include 37 38 .PATH.c: ${KERNDIR} 39 .if exists ($M/Makefile.inc) 40 .PATH.c: $M 41 .PATH.S: $M 42 .include "$M/Makefile.inc" 43 .endif 44 45 .if (${MACHINE_ARCH} != "alpha") 46 # Quad support 47 SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 48 lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 49 subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 50 .endif 51 52 # Other stuff 53 SRCS+= __assert.c __main.c 54 SRCS+= __cmsg_alignbytes.c cpuset.c inet_addr.c intoa.c 55 SRCS+= bswap64.c 56 SRCS+= md4c.c md5c.c rmd160.c sha1.c sha2.c 57 SRCS+= pmatch.c arc4random.c bcd.c mcount.c mertwist.c crc32.c 58 59 SRCS+= strsep.c strstr.c 60 SRCS+= strlcpy.c strlcat.c 61 62 SRCS+= imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c 63 SRCS+= memcpy.c memmove.c 64 SRCS+= strchr.c strrchr.c 65 SRCS+= memcmp.c memset.c 66 SRCS+= popcount32.c popcount64.c 67 SRCS+= strtoul.c strtoll.c strtoull.c strtoumax.c 68 69 SRCS+= scanc.c skpc.c 70 SRCS+= random.c 71 72 SRCS+= memchr.c 73 SRCS+= strcat.c strcmp.c strcpy.c strlen.c 74 SRCS+= strncmp.c strncpy.c 75 SRCS+= strcasecmp.c strncasecmp.c 76 77 SRCS+= xlat_mbr_fstype.c 78 79 SRCS+= heapsort.c ptree.c rb.c 80 81 # Files to clean up 82 CLEANFILES+= lib${LIB}.o lib${LIB}.po 83 84 # Remove from SRCS the .c files for any .S files added by the MD makefiles, 85 # also remove from SRCS the .c files for the .c files in NO_SRCS. 86 # (Unlike libc, we don't worry about lint) 87 88 .for check_file in ${SRCS:M*.S} ${NO_SRCS} 89 unwanted_file := ${SRCS:M${check_file:.S=.c}} 90 .if "${unwanted_file}" != "" 91 SRCS := ${SRCS:N${unwanted_file}} 92 .endif 93 .endfor 94 95