Makefile.libkern revision 1.4
11.4Sdsl# $NetBSD: Makefile.libkern,v 1.4 2009/08/12 21:18:42 dsl 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.1Spooka# KERNMICPPFLAGS: 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.1Spooka 361.1SpookaCPPFLAGS+= -I${KERNDIR}/../../../common/include 371.1Spooka 381.1Spooka.PATH.c: ${KERNDIR} 391.1Spooka.if exists ($M/Makefile.inc) 401.1Spooka.PATH.c: $M 411.1Spooka.PATH.S: $M 421.1Spooka.include "$M/Makefile.inc" 431.1Spooka.endif 441.1Spooka 451.1Spooka.if (${MACHINE_ARCH} != "alpha") 461.1Spooka# Quad support 471.1SpookaSRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ 481.1Spooka lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 491.1Spooka subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c 501.1Spooka.endif 511.1Spooka 521.1Spooka# Other stuff 531.1SpookaSRCS+= __cmsg_alignbytes.c cpuset.c inet_addr.c intoa.c 541.1SpookaSRCS+= md4c.c md5c.c rmd160.c sha1.c sha2.c 551.2SdarranSRCS+= pmatch.c arc4random.c bcd.c mcount.c mertwist.c crc32.c 561.1Spooka 571.4SdslSRCS+= strsep.c strstr.c 581.4SdslSRCS+= strlcpy.c strlcat.c 591.4SdslSRCS+= memcpy.c memmove.c 601.4SdslSRCS+= strchr.c strrchr.c 611.4SdslSRCS+= popcount32.c popcount64.c 621.1Spooka 631.1SpookaSRCS+= strtoll.c strtoull.c strtoumax.c 641.1Spooka 651.1SpookaSRCS+= xlat_mbr_fstype.c 661.1Spooka 671.1SpookaSRCS+= heapsort.c ptree.c rb.c 681.1Spooka 691.1Spooka# Files to clean up 701.1SpookaCLEANFILES+= lib${LIB}.o lib${LIB}.po 711.1Spooka 721.4Sdsl# Remove from SRCS the .c files for any .S files added by the MD makefiles, 731.4Sdsl# also remove from SRCS the .c files for the .S and .c files in NO_SRCS. 741.4Sdsl# 751.4Sdsl# Usage: 761.4Sdsl# Add .S files to NO_SRSC when another .S file provides the entry points. 771.4Sdsl# Add .c files to NO_SRSC when another .c file provides the entry points. 781.4Sdsl 791.4Sdsl.for check_file in ${SRCS:M*.S} ${NO_SRCS} 801.4Sdslunwanted_file := ${SRCS:M${check_file:.S=.c}} 811.4Sdsl.if "${unwanted_file}" != "" 821.4SdslSRCS := ${SRCS:N${unwanted_file}} 831.1Spooka.endif 841.4Sdsl.endfor 851.1Spooka 86