Makefile.libkern revision 1.15
11.15Stls# $NetBSD: Makefile.libkern,v 1.15 2011/11/19 22:51:25 tls Exp $ 21.1Spooka 31.1Spooka# 41.1Spooka# 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.13Sbouyer.include "${.PARSEDIR}/../../../common/lib/libquota/Makefile.inc" 371.1Spooka 381.1SpookaCPPFLAGS+= -I${KERNDIR}/../../../common/include 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.7Suebayasi.if (${MACHINE_ARCH} != "alpha") && \ 481.11Smatt (${MACHINE_ARCH} != "mips64eb" || !empty(CFLAGS:M-mabi=32)) && \ 491.11Smatt (${MACHINE_ARCH} != "mips64el" || !empty(CFLAGS:M-mabi=32)) && \ 501.7Suebayasi (${MACHINE_ARCH} != "powerpc64") && \ 511.7Suebayasi (${MACHINE_ARCH} != "sparc64") && \ 521.12Sjakllsch (${MACHINE_ARCH} != "x86_64" || !empty(CFLAGS:M-m32)) 531.1Spooka# Quad support 541.1SpookaSRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 551.1Spooka lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 561.1Spooka subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 571.1Spooka.endif 581.1Spooka 591.1Spooka# Other stuff 601.9SpookaSRCS+= kern_assert.c __main.c 611.1SpookaSRCS+= __cmsg_alignbytes.c cpuset.c inet_addr.c intoa.c 621.8Suebayasi.if empty(SRCS:Mbyte_swap_8.*) 631.5SdslSRCS+= bswap64.c 641.8Suebayasi.endif 651.1SpookaSRCS+= md4c.c md5c.c rmd160.c sha1.c sha2.c 661.2SdarranSRCS+= pmatch.c arc4random.c bcd.c mcount.c mertwist.c crc32.c 671.1Spooka 681.14SdyoungSRCS+= ppath_kmem_alloc.c 691.14Sdyoung 701.4SdslSRCS+= strsep.c strstr.c 711.4SdslSRCS+= strlcpy.c strlcat.c 721.5Sdsl 731.5SdslSRCS+= imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c 741.4SdslSRCS+= memcpy.c memmove.c 751.4SdslSRCS+= strchr.c strrchr.c 761.8SuebayasiSRCS+= memcmp.c 771.8Suebayasi.if empty(SRCS:Mmemset2.*) 781.8SuebayasiSRCS+= memset.c 791.8Suebayasi.endif 801.4SdslSRCS+= popcount32.c popcount64.c 811.5SdslSRCS+= strtoul.c strtoll.c strtoull.c strtoumax.c 821.5Sdsl 831.5SdslSRCS+= scanc.c skpc.c 841.5SdslSRCS+= random.c 851.15StlsSRCS+= rngtest.c 861.1Spooka 871.5SdslSRCS+= memchr.c 881.5SdslSRCS+= strcat.c strcmp.c strcpy.c strlen.c 891.5SdslSRCS+= strncmp.c strncpy.c 901.5SdslSRCS+= strcasecmp.c strncasecmp.c 911.1Spooka 921.1SpookaSRCS+= xlat_mbr_fstype.c 931.1Spooka 941.1SpookaSRCS+= heapsort.c ptree.c rb.c 951.1Spooka 961.1Spooka# Files to clean up 971.1SpookaCLEANFILES+= lib${LIB}.o lib${LIB}.po 981.1Spooka 991.4Sdsl# Remove from SRCS the .c files for any .S files added by the MD makefiles, 1001.5Sdsl# also remove from SRCS the .c files for the .c files in NO_SRCS. 1011.5Sdsl# (Unlike libc, we don't worry about lint) 1021.4Sdsl 1031.4Sdsl.for check_file in ${SRCS:M*.S} ${NO_SRCS} 1041.4Sdslunwanted_file := ${SRCS:M${check_file:.S=.c}} 1051.4Sdsl.if "${unwanted_file}" != "" 1061.4SdslSRCS := ${SRCS:N${unwanted_file}} 1071.1Spooka.endif 1081.4Sdsl.endfor 109