Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / lib / libkern / Makefile.libkern
blob0cf77bf88073642c436166707476c80625beb084
1 #       $NetBSD$
3
4 # Variable definitions for libkern.  
6 # Before including this, you _must_ set
7 #   KERNDIR: location of sys/lib/libkern
9 # You *may* set:
10 #   LIBKERN_ARCH: architecture subdir to be used
11 #   KERNCPPFLAGS: see Makefile.inc
12 #   KERNMICPPFLAGS: see Makefile.inc
15 .include <bsd.own.mk>
17 .if defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \
18     exists(${KERNDIR}/arch/${LIBKERN_ARCH})
19 ARCHSUBDIR=     ${LIBKERN_ARCH}
20 .elif defined(MACHINE_ARCH) && !empty(MACHINE_ARCH) && \
21     exists(${KERNDIR}/arch/${MACHINE_ARCH})
22 ARCHSUBDIR=     ${MACHINE_ARCH}
23 .elif defined(MACHINE_CPU) && !empty(MACHINE_CPU) && \
24     exists(${KERNDIR}/arch/${MACHINE_CPU})
25 ARCHSUBDIR=     ${MACHINE_CPU}
26 .endif
28 M= ${KERNDIR}/arch/${ARCHSUBDIR}
30 CPPFLAGS+=      -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS}
32 .include "${.PARSEDIR}/../../../common/lib/libc/Makefile.inc"
33 .include "${.PARSEDIR}/../../../common/lib/libutil/Makefile.inc"
34 .include "${.PARSEDIR}/../../../common/lib/libprop/Makefile.inc"
36 CPPFLAGS+=      -I${KERNDIR}/../../../common/include
38 .PATH.c: ${KERNDIR}
39 .if exists ($M/Makefile.inc)
40 .PATH.c: $M
41 .PATH.S: $M
42 .include "$M/Makefile.inc"
43 .endif
45 .if (${MACHINE_ARCH} != "alpha") && \
46     (${MACHINE_ARCH} != "mips64eb") && \
47     (${MACHINE_ARCH} != "mips64el") && \
48     (${MACHINE_ARCH} != "powerpc64") && \
49     (${MACHINE_ARCH} != "sparc64") && \
50     (${MACHINE_ARCH} != "x86_64")
51 # Quad support
52 SRCS+=  adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
53         lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
54         subdi3.c  ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
55 .endif
57 # Other stuff
58 SRCS+=  __assert.c __main.c
59 SRCS+=  __cmsg_alignbytes.c cpuset.c inet_addr.c intoa.c
60 .if empty(SRCS:Mbyte_swap_8.*)
61 SRCS+=  bswap64.c
62 .endif
63 SRCS+=  md4c.c md5c.c rmd160.c sha1.c sha2.c
64 SRCS+=  pmatch.c arc4random.c bcd.c mcount.c mertwist.c crc32.c
66 SRCS+=  strsep.c strstr.c
67 SRCS+=  strlcpy.c strlcat.c
69 SRCS+=  imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c
70 SRCS+=  memcpy.c memmove.c
71 SRCS+=  strchr.c strrchr.c
72 SRCS+=  memcmp.c
73 .if empty(SRCS:Mmemset2.*)
74 SRCS+=  memset.c 
75 .endif
76 SRCS+=  popcount32.c popcount64.c
77 SRCS+=  strtoul.c strtoll.c strtoull.c strtoumax.c
79 SRCS+=  scanc.c skpc.c
80 SRCS+=  random.c
82 SRCS+=  memchr.c
83 SRCS+=  strcat.c strcmp.c strcpy.c strlen.c
84 SRCS+=  strncmp.c strncpy.c
85 SRCS+=  strcasecmp.c strncasecmp.c
87 SRCS+=  xlat_mbr_fstype.c
89 SRCS+=  heapsort.c ptree.c rb.c
91 # Files to clean up
92 CLEANFILES+= lib${LIB}.o lib${LIB}.po
94 # Remove from SRCS the .c files for any .S files added by the MD makefiles,
95 # also remove from SRCS the .c files for the .c files in NO_SRCS.
96 # (Unlike libc, we don't worry about lint)
98 .for check_file in ${SRCS:M*.S} ${NO_SRCS}
99 unwanted_file := ${SRCS:M${check_file:.S=.c}}
100 .if "${unwanted_file}" != ""
101 SRCS := ${SRCS:N${unwanted_file}}
102 .endif
103 .endfor