Home | History | Annotate | Line # | Download | only in libkern
Makefile.libkern revision 1.4
      1  1.4     dsl #	$NetBSD: Makefile.libkern,v 1.4 2009/08/12 21:18:42 dsl Exp $
      2  1.1   pooka 
      3  1.1   pooka # 
      4  1.1   pooka # 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.1   pooka #   KERNMICPPFLAGS: 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.1   pooka 
     36  1.1   pooka CPPFLAGS+=	-I${KERNDIR}/../../../common/include
     37  1.1   pooka 
     38  1.1   pooka .PATH.c: ${KERNDIR}
     39  1.1   pooka .if exists ($M/Makefile.inc)
     40  1.1   pooka .PATH.c: $M
     41  1.1   pooka .PATH.S: $M
     42  1.1   pooka .include "$M/Makefile.inc"
     43  1.1   pooka .endif
     44  1.1   pooka 
     45  1.1   pooka .if (${MACHINE_ARCH} != "alpha")
     46  1.1   pooka # Quad support
     47  1.1   pooka SRCS+=	adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
     48  1.1   pooka 	lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
     49  1.1   pooka 	subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
     50  1.1   pooka .endif
     51  1.1   pooka 
     52  1.1   pooka # Other stuff
     53  1.1   pooka SRCS+=	__cmsg_alignbytes.c cpuset.c inet_addr.c intoa.c
     54  1.1   pooka SRCS+=	md4c.c md5c.c rmd160.c sha1.c sha2.c
     55  1.2  darran SRCS+=	pmatch.c arc4random.c bcd.c mcount.c mertwist.c crc32.c
     56  1.1   pooka 
     57  1.4     dsl SRCS+=	strsep.c strstr.c
     58  1.4     dsl SRCS+=	strlcpy.c strlcat.c
     59  1.4     dsl SRCS+=	memcpy.c memmove.c
     60  1.4     dsl SRCS+=	strchr.c strrchr.c
     61  1.4     dsl SRCS+=	popcount32.c popcount64.c
     62  1.1   pooka 
     63  1.1   pooka SRCS+=	strtoll.c strtoull.c strtoumax.c
     64  1.1   pooka 
     65  1.1   pooka SRCS+=	xlat_mbr_fstype.c
     66  1.1   pooka 
     67  1.1   pooka SRCS+=	heapsort.c ptree.c rb.c
     68  1.1   pooka 
     69  1.1   pooka # Files to clean up
     70  1.1   pooka CLEANFILES+= lib${LIB}.o lib${LIB}.po
     71  1.1   pooka 
     72  1.4     dsl # Remove from SRCS the .c files for any .S files added by the MD makefiles,
     73  1.4     dsl # also remove from SRCS the .c files for the .S and .c files in NO_SRCS.
     74  1.4     dsl #
     75  1.4     dsl # Usage: 
     76  1.4     dsl # Add .S files to NO_SRSC when another .S file provides the entry points.
     77  1.4     dsl # Add .c files to NO_SRSC when another .c file provides the entry points.
     78  1.4     dsl 
     79  1.4     dsl .for check_file in ${SRCS:M*.S} ${NO_SRCS}
     80  1.4     dsl unwanted_file := ${SRCS:M${check_file:.S=.c}}
     81  1.4     dsl .if "${unwanted_file}" != ""
     82  1.4     dsl SRCS := ${SRCS:N${unwanted_file}}
     83  1.1   pooka .endif
     84  1.4     dsl .endfor
     85  1.1   pooka 
     86