Makefile.libkern revision 1.49
11.49Smaxv# $NetBSD: Makefile.libkern,v 1.49 2020/06/30 16:20:02 maxv Exp $ 21.1Spooka 31.47Sriastrad# 41.47Sriastrad# Variable definitions for libkern. 51.1Spooka# 61.1Spooka# Before including this, you _must_ set 71.1Spooka# KERNDIR: location of sys/lib/libkern 81.1Spooka# 91.1Spooka# You *may* set: 101.1Spooka# LIBKERN_ARCH: architecture subdir to be used 111.1Spooka# KERNCPPFLAGS: see Makefile.inc 121.10Spooka# KERNMISCCPPFLAGS: see Makefile.inc 131.1Spooka# 141.1Spooka 151.1Spooka.include <bsd.own.mk> 161.1Spooka 171.1Spooka.if defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \ 181.1Spooka exists(${KERNDIR}/arch/${LIBKERN_ARCH}) 191.1SpookaARCHSUBDIR= ${LIBKERN_ARCH} 201.1Spooka.elif defined(MACHINE_ARCH) && !empty(MACHINE_ARCH) && \ 211.1Spooka exists(${KERNDIR}/arch/${MACHINE_ARCH}) 221.1SpookaARCHSUBDIR= ${MACHINE_ARCH} 231.1Spooka.elif defined(MACHINE_CPU) && !empty(MACHINE_CPU) && \ 241.1Spooka exists(${KERNDIR}/arch/${MACHINE_CPU}) 251.1SpookaARCHSUBDIR= ${MACHINE_CPU} 261.1Spooka.endif 271.1Spooka 281.1SpookaM= ${KERNDIR}/arch/${ARCHSUBDIR} 291.1Spooka 301.1SpookaCPPFLAGS+= -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS} 311.1Spooka 321.1Spooka.include "${.PARSEDIR}/../../../common/lib/libc/Makefile.inc" 331.1Spooka.include "${.PARSEDIR}/../../../common/lib/libutil/Makefile.inc" 341.1Spooka.include "${.PARSEDIR}/../../../common/lib/libprop/Makefile.inc" 351.14Sdyoung.include "${.PARSEDIR}/../../../common/lib/libppath/Makefile.inc" 361.1Spooka 371.1SpookaCPPFLAGS+= -I${KERNDIR}/../../../common/include 381.48SriastradCPPFLAGS+= -I${KERNDIR}/../../../common/libc/hash/sha3 391.1Spooka 401.1Spooka.PATH.c: ${KERNDIR} 411.1Spooka.if exists ($M/Makefile.inc) 421.1Spooka.PATH.c: $M 431.1Spooka.PATH.S: $M 441.1Spooka.include "$M/Makefile.inc" 451.1Spooka.endif 461.1Spooka 471.32Spooka.if !defined(RUMPKERNEL) 481.33Sjmcneill.include "${.PARSEDIR}/Makefile.compiler-rt" 491.32Spooka.endif 501.1Spooka 511.1Spooka# Other stuff 521.9SpookaSRCS+= kern_assert.c __main.c 531.16SjoergSRCS+= cpuset.c inet_addr.c intoa.c 541.8Suebayasi.if empty(SRCS:Mbyte_swap_8.*) 551.5SdslSRCS+= bswap64.c 561.8Suebayasi.endif 571.40SriastradSRCS+= md4c.c md5c.c rmd160.c sha1.c sha2.c sha3.c keccak.c murmurhash.c 581.46SriastradSRCS+= pmatch.c mcount.c crc32.c 591.1Spooka 601.14SdyoungSRCS+= ppath_kmem_alloc.c 611.14Sdyoung 621.49SmaxvSRCS+= copystr.c 631.4SdslSRCS+= strsep.c strstr.c 641.4SdslSRCS+= strlcpy.c strlcat.c 651.5Sdsl 661.43SriastradSRCS+= imax.c imin.c lmax.c lmin.c uimax.c uimin.c ulmax.c ulmin.c 671.20SchristosSRCS+= memmove.c 681.4SdslSRCS+= strchr.c strrchr.c 691.42SchristosSRCS+= memcmp.c memmem.c 701.20Schristos 711.20SchristosSRCS+= memcpy.c 721.8Suebayasi.if empty(SRCS:Mmemset2.*) 731.47SriastradSRCS+= memset.c 741.8Suebayasi.endif 751.23Schristos 761.4SdslSRCS+= popcount32.c popcount64.c 771.27SlnetoSRCS+= strtoul.c strtoll.c strtoull.c strtoimax.c strtoumax.c 781.37SchristosSRCS+= strtoi.c strtou.c 791.39SchristosSRCS+= strnvisx.c 801.5Sdsl 811.5SdslSRCS+= scanc.c skpc.c 821.5SdslSRCS+= random.c 831.15StlsSRCS+= rngtest.c 841.1Spooka 851.5SdslSRCS+= memchr.c 861.34SlnetoSRCS+= strcat.c strcmp.c strcpy.c strcspn.c strlen.c strnlen.c 871.34SlnetoSRCS+= strncat.c strncmp.c strncpy.c strpbrk.c strspn.c 881.5SdslSRCS+= strcasecmp.c strncasecmp.c 891.1Spooka 901.1SpookaSRCS+= xlat_mbr_fstype.c 911.1Spooka 921.44SadSRCS+= heapsort.c ptree.c radixtree.c rb.c rpst.c 931.1Spooka 941.41SchristosSRCS+= hexdump.c 951.41Schristos 961.18Sdrochner# for crypto 971.24SriastradSRCS+= explicit_memset.c consttime_memequal.c 981.18Sdrochner 991.48SriastradSRCS+= entpool.c 1001.48Sriastrad 1011.28Sjoerg.PATH: ${NETBSDSRCDIR}/common/lib/libc/cdb 1021.28SjoergSRCS+= cdbr.c 1031.28SjoergSRCS+= mi_vector_hash.c 1041.28Sjoerg 1051.1Spooka# Files to clean up 1061.1SpookaCLEANFILES+= lib${LIB}.o lib${LIB}.po 1071.1Spooka 1081.4Sdsl# Remove from SRCS the .c files for any .S files added by the MD makefiles, 1091.5Sdsl# also remove from SRCS the .c files for the .c files in NO_SRCS. 1101.5Sdsl# (Unlike libc, we don't worry about lint) 1111.4Sdsl 1121.4Sdsl.for check_file in ${SRCS:M*.S} ${NO_SRCS} 1131.4Sdslunwanted_file := ${SRCS:M${check_file:.S=.c}} 1141.4Sdsl.if "${unwanted_file}" != "" 1151.4SdslSRCS := ${SRCS:N${unwanted_file}} 1161.1Spooka.endif 1171.4Sdsl.endfor 118