1 1.30 joerg # $NetBSD: Makefile.libkern,v 1.30 2014/01/15 21:12:57 joerg Exp $ 2 1.1 pooka 3 1.1 pooka # 4 1.1 pooka # Variable definitions for libkern. 5 1.1 pooka # 6 1.1 pooka # Before including this, you _must_ set 7 1.1 pooka # KERNDIR: location of sys/lib/libkern 8 1.1 pooka # 9 1.1 pooka # You *may* set: 10 1.1 pooka # LIBKERN_ARCH: architecture subdir to be used 11 1.1 pooka # KERNCPPFLAGS: see Makefile.inc 12 1.10 pooka # KERNMISCCPPFLAGS: see Makefile.inc 13 1.1 pooka # 14 1.1 pooka 15 1.1 pooka .include <bsd.own.mk> 16 1.1 pooka 17 1.1 pooka .if defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \ 18 1.1 pooka exists(${KERNDIR}/arch/${LIBKERN_ARCH}) 19 1.1 pooka ARCHSUBDIR= ${LIBKERN_ARCH} 20 1.1 pooka .elif defined(MACHINE_ARCH) && !empty(MACHINE_ARCH) && \ 21 1.1 pooka exists(${KERNDIR}/arch/${MACHINE_ARCH}) 22 1.1 pooka ARCHSUBDIR= ${MACHINE_ARCH} 23 1.1 pooka .elif defined(MACHINE_CPU) && !empty(MACHINE_CPU) && \ 24 1.1 pooka exists(${KERNDIR}/arch/${MACHINE_CPU}) 25 1.1 pooka ARCHSUBDIR= ${MACHINE_CPU} 26 1.1 pooka .endif 27 1.1 pooka 28 1.1 pooka M= ${KERNDIR}/arch/${ARCHSUBDIR} 29 1.1 pooka 30 1.1 pooka CPPFLAGS+= -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS} 31 1.1 pooka 32 1.1 pooka .include "${.PARSEDIR}/../../../common/lib/libc/Makefile.inc" 33 1.1 pooka .include "${.PARSEDIR}/../../../common/lib/libutil/Makefile.inc" 34 1.1 pooka .include "${.PARSEDIR}/../../../common/lib/libprop/Makefile.inc" 35 1.14 dyoung .include "${.PARSEDIR}/../../../common/lib/libppath/Makefile.inc" 36 1.1 pooka 37 1.1 pooka CPPFLAGS+= -I${KERNDIR}/../../../common/include 38 1.1 pooka 39 1.1 pooka .PATH.c: ${KERNDIR} 40 1.1 pooka .if exists ($M/Makefile.inc) 41 1.1 pooka .PATH.c: $M 42 1.1 pooka .PATH.S: $M 43 1.1 pooka .include "$M/Makefile.inc" 44 1.1 pooka .endif 45 1.1 pooka 46 1.30 joerg .if ${HAVE_LIBGCC} == "no" 47 1.30 joerg .include ".${PARSEDIR}/Makefile.compiler-rt" 48 1.30 joerg .else 49 1.7 uebayasi .if (${MACHINE_ARCH} != "alpha") && \ 50 1.11 matt (${MACHINE_ARCH} != "mips64eb" || !empty(CFLAGS:M-mabi=32)) && \ 51 1.11 matt (${MACHINE_ARCH} != "mips64el" || !empty(CFLAGS:M-mabi=32)) && \ 52 1.7 uebayasi (${MACHINE_ARCH} != "powerpc64") && \ 53 1.7 uebayasi (${MACHINE_ARCH} != "sparc64") && \ 54 1.12 jakllsch (${MACHINE_ARCH} != "x86_64" || !empty(CFLAGS:M-m32)) 55 1.1 pooka # Quad support 56 1.1 pooka SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 57 1.1 pooka lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 58 1.1 pooka subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 59 1.1 pooka .endif 60 1.30 joerg .endif 61 1.1 pooka 62 1.1 pooka # Other stuff 63 1.9 pooka SRCS+= kern_assert.c __main.c 64 1.16 joerg SRCS+= cpuset.c inet_addr.c intoa.c 65 1.8 uebayasi .if empty(SRCS:Mbyte_swap_8.*) 66 1.5 dsl SRCS+= bswap64.c 67 1.8 uebayasi .endif 68 1.25 rmind SRCS+= md4c.c md5c.c rmd160.c sha1.c sha2.c murmurhash.c 69 1.2 darran SRCS+= pmatch.c arc4random.c bcd.c mcount.c mertwist.c crc32.c 70 1.1 pooka 71 1.14 dyoung SRCS+= ppath_kmem_alloc.c 72 1.14 dyoung 73 1.4 dsl SRCS+= strsep.c strstr.c 74 1.4 dsl SRCS+= strlcpy.c strlcat.c 75 1.5 dsl 76 1.5 dsl SRCS+= imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c 77 1.20 christos SRCS+= memmove.c 78 1.4 dsl SRCS+= strchr.c strrchr.c 79 1.8 uebayasi SRCS+= memcmp.c 80 1.20 christos 81 1.20 christos SRCS+= memcpy.c 82 1.8 uebayasi .if empty(SRCS:Mmemset2.*) 83 1.8 uebayasi SRCS+= memset.c 84 1.8 uebayasi .endif 85 1.23 christos 86 1.4 dsl SRCS+= popcount32.c popcount64.c 87 1.27 lneto SRCS+= strtoul.c strtoll.c strtoull.c strtoimax.c strtoumax.c 88 1.5 dsl 89 1.5 dsl SRCS+= scanc.c skpc.c 90 1.5 dsl SRCS+= random.c 91 1.15 tls SRCS+= rngtest.c 92 1.1 pooka 93 1.5 dsl SRCS+= memchr.c 94 1.19 matt SRCS+= strcat.c strcmp.c strcpy.c strlen.c strnlen.c 95 1.29 christos SRCS+= strncat.c strncmp.c strncpy.c 96 1.5 dsl SRCS+= strcasecmp.c strncasecmp.c 97 1.1 pooka 98 1.1 pooka SRCS+= xlat_mbr_fstype.c 99 1.1 pooka 100 1.1 pooka SRCS+= heapsort.c ptree.c rb.c 101 1.1 pooka 102 1.18 drochner # for crypto 103 1.24 riastrad SRCS+= explicit_memset.c consttime_memequal.c 104 1.18 drochner 105 1.28 joerg .PATH: ${NETBSDSRCDIR}/common/lib/libc/cdb 106 1.28 joerg SRCS+= cdbr.c 107 1.28 joerg SRCS+= mi_vector_hash.c 108 1.28 joerg 109 1.1 pooka # Files to clean up 110 1.1 pooka CLEANFILES+= lib${LIB}.o lib${LIB}.po 111 1.1 pooka 112 1.4 dsl # Remove from SRCS the .c files for any .S files added by the MD makefiles, 113 1.5 dsl # also remove from SRCS the .c files for the .c files in NO_SRCS. 114 1.5 dsl # (Unlike libc, we don't worry about lint) 115 1.4 dsl 116 1.4 dsl .for check_file in ${SRCS:M*.S} ${NO_SRCS} 117 1.4 dsl unwanted_file := ${SRCS:M${check_file:.S=.c}} 118 1.4 dsl .if "${unwanted_file}" != "" 119 1.4 dsl SRCS := ${SRCS:N${unwanted_file}} 120 1.1 pooka .endif 121 1.4 dsl .endfor 122 1.26 skrll 123 1.26 skrll .if ${HAVE_GCC:U} == "45" && ${MACHINE_CPU} == "hppa" 124 1.26 skrll COPTS.md5c.c += ${${ACTIVE_CC} == "gcc" :? -O0 :} 125 1.26 skrll .endif 126