Home | History | Annotate | Line # | Download | only in libkern
      1  1.55       kre #	$NetBSD: Makefile.libkern,v 1.55 2024/01/20 11:04:53 kre Exp $
      2   1.1     pooka 
      3  1.47  riastrad #
      4  1.47  riastrad # 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.55       kre CPPFLAGS+=	-I${KERNDIR}/../../../common/include/libc
     39  1.48  riastrad CPPFLAGS+=	-I${KERNDIR}/../../../common/libc/hash/sha3
     40   1.1     pooka 
     41   1.1     pooka .PATH.c: ${KERNDIR}
     42   1.1     pooka .if exists ($M/Makefile.inc)
     43   1.1     pooka .PATH.c: $M
     44   1.1     pooka .PATH.S: $M
     45   1.1     pooka .include "$M/Makefile.inc"
     46   1.1     pooka .endif
     47   1.1     pooka 
     48  1.32     pooka .if !defined(RUMPKERNEL)
     49  1.33  jmcneill .include "${.PARSEDIR}/Makefile.compiler-rt"
     50  1.32     pooka .endif
     51   1.1     pooka 
     52   1.1     pooka # Other stuff
     53   1.9     pooka SRCS+=	kern_assert.c __main.c
     54  1.16     joerg SRCS+=	cpuset.c inet_addr.c intoa.c
     55   1.8  uebayasi .if empty(SRCS:Mbyte_swap_8.*)
     56   1.5       dsl SRCS+=	bswap64.c
     57   1.8  uebayasi .endif
     58  1.40  riastrad SRCS+=	md4c.c md5c.c rmd160.c sha1.c sha2.c sha3.c keccak.c murmurhash.c
     59  1.53       ryo SRCS+=	pmatch.c mcount.c crc32.c
     60  1.50   thorpej SRCS+=	strlist.c
     61   1.1     pooka 
     62  1.14    dyoung SRCS+=	ppath_kmem_alloc.c
     63  1.14    dyoung 
     64  1.49      maxv SRCS+=	copystr.c
     65   1.4       dsl SRCS+=	strsep.c strstr.c
     66   1.4       dsl SRCS+=	strlcpy.c strlcat.c
     67   1.5       dsl 
     68  1.43  riastrad SRCS+=	imax.c imin.c lmax.c lmin.c uimax.c uimin.c ulmax.c ulmin.c
     69  1.20  christos SRCS+=	memmove.c
     70   1.4       dsl SRCS+=	strchr.c strrchr.c
     71  1.42  christos SRCS+=	memcmp.c memmem.c
     72  1.20  christos 
     73  1.20  christos SRCS+=	memcpy.c
     74   1.8  uebayasi .if empty(SRCS:Mmemset2.*)
     75  1.47  riastrad SRCS+=	memset.c
     76   1.8  uebayasi .endif
     77  1.23  christos 
     78   1.4       dsl SRCS+=	popcount32.c popcount64.c
     79  1.27     lneto SRCS+=	strtoul.c strtoll.c strtoull.c strtoimax.c strtoumax.c
     80  1.37  christos SRCS+=	strtoi.c strtou.c
     81  1.39  christos SRCS+=	strnvisx.c
     82   1.5       dsl 
     83   1.5       dsl SRCS+=	scanc.c skpc.c
     84   1.5       dsl SRCS+=	random.c
     85  1.15       tls SRCS+=	rngtest.c
     86   1.1     pooka 
     87   1.5       dsl SRCS+=	memchr.c
     88  1.34     lneto SRCS+=	strcat.c strcmp.c strcpy.c strcspn.c strlen.c strnlen.c
     89  1.34     lneto SRCS+=	strncat.c strncmp.c strncpy.c strpbrk.c strspn.c
     90   1.5       dsl SRCS+=	strcasecmp.c strncasecmp.c
     91   1.1     pooka 
     92   1.1     pooka SRCS+=	xlat_mbr_fstype.c
     93   1.1     pooka 
     94  1.44        ad SRCS+=	heapsort.c ptree.c radixtree.c rb.c rpst.c
     95   1.1     pooka 
     96  1.41  christos SRCS+=	hexdump.c
     97  1.41  christos 
     98  1.18  drochner # for crypto
     99  1.24  riastrad SRCS+=	explicit_memset.c consttime_memequal.c
    100  1.18  drochner 
    101  1.48  riastrad SRCS+=	entpool.c
    102  1.48  riastrad 
    103  1.51       mrg SRCS+=	dkcksum.c
    104  1.51       mrg SRCS+=	disklabel_swap.c
    105  1.51       mrg 
    106  1.54   rhialto .PATH:	${.PARSEDIR}/../../../common/lib/libc/cdb
    107  1.28     joerg SRCS+=	cdbr.c
    108  1.28     joerg SRCS+=	mi_vector_hash.c
    109  1.28     joerg 
    110   1.1     pooka # Files to clean up
    111   1.1     pooka CLEANFILES+= lib${LIB}.o lib${LIB}.po
    112   1.1     pooka 
    113   1.4       dsl # Remove from SRCS the .c files for any .S files added by the MD makefiles,
    114   1.5       dsl # also remove from SRCS the .c files for the .c files in NO_SRCS.
    115   1.5       dsl # (Unlike libc, we don't worry about lint)
    116   1.4       dsl 
    117   1.4       dsl .for check_file in ${SRCS:M*.S} ${NO_SRCS}
    118   1.4       dsl unwanted_file := ${SRCS:M${check_file:.S=.c}}
    119   1.4       dsl .if "${unwanted_file}" != ""
    120   1.4       dsl SRCS := ${SRCS:N${unwanted_file}}
    121   1.1     pooka .endif
    122   1.4       dsl .endfor
    123