Makefile.libkern revision 1.55
11.55Skre# $NetBSD: Makefile.libkern,v 1.55 2024/01/20 11:04:53 kre 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.55SkreCPPFLAGS+= -I${KERNDIR}/../../../common/include/libc 391.48SriastradCPPFLAGS+= -I${KERNDIR}/../../../common/libc/hash/sha3 401.1Spooka 411.1Spooka.PATH.c: ${KERNDIR} 421.1Spooka.if exists ($M/Makefile.inc) 431.1Spooka.PATH.c: $M 441.1Spooka.PATH.S: $M 451.1Spooka.include "$M/Makefile.inc" 461.1Spooka.endif 471.1Spooka 481.32Spooka.if !defined(RUMPKERNEL) 491.33Sjmcneill.include "${.PARSEDIR}/Makefile.compiler-rt" 501.32Spooka.endif 511.1Spooka 521.1Spooka# Other stuff 531.9SpookaSRCS+= kern_assert.c __main.c 541.16SjoergSRCS+= cpuset.c inet_addr.c intoa.c 551.8Suebayasi.if empty(SRCS:Mbyte_swap_8.*) 561.5SdslSRCS+= bswap64.c 571.8Suebayasi.endif 581.40SriastradSRCS+= md4c.c md5c.c rmd160.c sha1.c sha2.c sha3.c keccak.c murmurhash.c 591.53SryoSRCS+= pmatch.c mcount.c crc32.c 601.50SthorpejSRCS+= strlist.c 611.1Spooka 621.14SdyoungSRCS+= ppath_kmem_alloc.c 631.14Sdyoung 641.49SmaxvSRCS+= copystr.c 651.4SdslSRCS+= strsep.c strstr.c 661.4SdslSRCS+= strlcpy.c strlcat.c 671.5Sdsl 681.43SriastradSRCS+= imax.c imin.c lmax.c lmin.c uimax.c uimin.c ulmax.c ulmin.c 691.20SchristosSRCS+= memmove.c 701.4SdslSRCS+= strchr.c strrchr.c 711.42SchristosSRCS+= memcmp.c memmem.c 721.20Schristos 731.20SchristosSRCS+= memcpy.c 741.8Suebayasi.if empty(SRCS:Mmemset2.*) 751.47SriastradSRCS+= memset.c 761.8Suebayasi.endif 771.23Schristos 781.4SdslSRCS+= popcount32.c popcount64.c 791.27SlnetoSRCS+= strtoul.c strtoll.c strtoull.c strtoimax.c strtoumax.c 801.37SchristosSRCS+= strtoi.c strtou.c 811.39SchristosSRCS+= strnvisx.c 821.5Sdsl 831.5SdslSRCS+= scanc.c skpc.c 841.5SdslSRCS+= random.c 851.15StlsSRCS+= rngtest.c 861.1Spooka 871.5SdslSRCS+= memchr.c 881.34SlnetoSRCS+= strcat.c strcmp.c strcpy.c strcspn.c strlen.c strnlen.c 891.34SlnetoSRCS+= strncat.c strncmp.c strncpy.c strpbrk.c strspn.c 901.5SdslSRCS+= strcasecmp.c strncasecmp.c 911.1Spooka 921.1SpookaSRCS+= xlat_mbr_fstype.c 931.1Spooka 941.44SadSRCS+= heapsort.c ptree.c radixtree.c rb.c rpst.c 951.1Spooka 961.41SchristosSRCS+= hexdump.c 971.41Schristos 981.18Sdrochner# for crypto 991.24SriastradSRCS+= explicit_memset.c consttime_memequal.c 1001.18Sdrochner 1011.48SriastradSRCS+= entpool.c 1021.48Sriastrad 1031.51SmrgSRCS+= dkcksum.c 1041.51SmrgSRCS+= disklabel_swap.c 1051.51Smrg 1061.54Srhialto.PATH: ${.PARSEDIR}/../../../common/lib/libc/cdb 1071.28SjoergSRCS+= cdbr.c 1081.28SjoergSRCS+= mi_vector_hash.c 1091.28Sjoerg 1101.1Spooka# Files to clean up 1111.1SpookaCLEANFILES+= lib${LIB}.o lib${LIB}.po 1121.1Spooka 1131.4Sdsl# Remove from SRCS the .c files for any .S files added by the MD makefiles, 1141.5Sdsl# also remove from SRCS the .c files for the .c files in NO_SRCS. 1151.5Sdsl# (Unlike libc, we don't worry about lint) 1161.4Sdsl 1171.4Sdsl.for check_file in ${SRCS:M*.S} ${NO_SRCS} 1181.4Sdslunwanted_file := ${SRCS:M${check_file:.S=.c}} 1191.4Sdsl.if "${unwanted_file}" != "" 1201.4SdslSRCS := ${SRCS:N${unwanted_file}} 1211.1Spooka.endif 1221.4Sdsl.endfor 123