summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/Makefile.inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/Makefile.inc')
-rw-r--r--src/lib/libc/string/Makefile.inc118
1 files changed, 90 insertions, 28 deletions
diff --git a/src/lib/libc/string/Makefile.inc b/src/lib/libc/string/Makefile.inc
index 2b7ce63a63..40713956e5 100644
--- a/src/lib/libc/string/Makefile.inc
+++ b/src/lib/libc/string/Makefile.inc
@@ -1,36 +1,45 @@
1# from: @(#)Makefile.inc 5.6 (Berkeley) 3/5/91 1# $OpenBSD: Makefile.inc,v 1.27 2011/07/09 16:32:11 nicm Exp $
2# $Id: Makefile.inc,v 1.1.1.1 1995/10/18 08:42:20 deraadt Exp $
3 2
4# string sources 3# string sources
5.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/string ${.CURDIR}/string 4.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/string ${LIBCSRCDIR}/string
6 5
7SRCS+= bm.c memccpy.c strcasecmp.c strcoll.c strdup.c strerror.c \ 6SRCS+= bm.c memccpy.c memrchr.c strcasecmp.c strcasestr.c strcoll.c strdup.c \
8 strftime.c strmode.c strsignal.c strtok.c strxfrm.c \ 7 strerror.c strerror_r.c strlcat.c strmode.c strndup.c strnlen.c \
9 __strerror.c __strsignal.c 8 strsignal.c strtok.c strxfrm.c \
9 wcscat.c wcschr.c wcscmp.c wcscpy.c wcscspn.c wcslcat.c wcslcpy.c \
10 wcslen.c wcsncat.c wcsncmp.c wcsncpy.c wcspbrk.c wcsrchr.c wcsspn.c \
11 wcsstr.c wcstok.c wcswcs.c wcswidth.c wmemchr.c wmemcmp.c wmemcpy.c \
12 wmemmove.c wmemset.c wcsdup.c \
13 timingsafe_bcmp.c wcscasecmp.c
10 14
11# machine-dependent net sources 15# machine-dependent net sources
12# m-d Makefile.inc must include sources for: 16# m-d Makefile.inc must include sources for:
13# bcmp() bcopy() bzero() ffs() index() memchr() memcmp() memset() 17# bcmp() bcopy() bzero() ffs() index() memchr() memcmp() memset()
14# rindex() strcat() strcmp() strcpy() strcspn() strlen() 18# rindex() strcat() strcmp() strcpy() strcspn() strlen() strlcpy()
15# strncat() strncmp() strncpy() strpbrk() strsep() 19# strncat() strncmp() strncpy() strpbrk() strsep()
16# strspn() strstr() swav() 20# strspn() strstr() swav()
17# m-d Makefile.inc may include sources for: 21# m-d Makefile.inc may include sources for:
18# memcpy() memmove() strchr() strrchr() 22# memcpy() memmove() strchr() strrchr()
19 23
20.include "${.CURDIR}/arch/${MACHINE_ARCH}/string/Makefile.inc" 24.include "${LIBCSRCDIR}/arch/${MACHINE_CPU}/string/Makefile.inc"
21 25
22# if no machine specific memmove(3), build one out of bcopy(3). 26# if no machine specific memmove(3), build one out of bcopy(3).
23.if empty(SRCS:Mmemmove.S) 27.if empty(SRCS:Mmemmove.S)
24OBJS+= memmove.o 28OBJS+= memmove.o
25memmove.o: bcopy.c 29memmove.o: bcopy.c
26 ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 30 ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
27 @${LD} -x -r ${.TARGET} 31 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
28 @mv a.out ${.TARGET} 32 @mv ${.TARGET}.tmp ${.TARGET}
33
34memmove.go: bcopy.c
35 ${CC} -g -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
36 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
37 @mv ${.TARGET}.tmp ${.TARGET}
29 38
30memmove.po: bcopy.c 39memmove.po: bcopy.c
31 ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 40 ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
32 @${LD} -X -r ${.TARGET} 41 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
33 @mv a.out ${.TARGET} 42 @mv ${.TARGET}.tmp ${.TARGET}
34 43
35memmove.so: bcopy.c 44memmove.so: bcopy.c
36 ${CC} ${PICFLAG} -DPIC -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 45 ${CC} ${PICFLAG} -DPIC -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
@@ -45,13 +54,18 @@ memmove.so: bcopy.c
45OBJS+= memcpy.o 54OBJS+= memcpy.o
46memcpy.o: bcopy.c 55memcpy.o: bcopy.c
47 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 56 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
48 @${LD} -x -r ${.TARGET} 57 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
49 @mv a.out ${.TARGET} 58 @mv ${.TARGET}.tmp ${.TARGET}
59
60memcpy.go: bcopy.c
61 ${CC} -g -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
62 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
63 @mv ${.TARGET}.tmp ${.TARGET}
50 64
51memcpy.po: bcopy.c 65memcpy.po: bcopy.c
52 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 66 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
53 @${LD} -X -r ${.TARGET} 67 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
54 @mv a.out ${.TARGET} 68 @mv ${.TARGET}.tmp ${.TARGET}
55 69
56memcpy.so: bcopy.c 70memcpy.so: bcopy.c
57 ${CC} ${PICFLAG} -DPIC -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 71 ${CC} ${PICFLAG} -DPIC -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
@@ -64,13 +78,18 @@ memcpy.so: bcopy.c
64OBJS+= strchr.o 78OBJS+= strchr.o
65strchr.o: index.c 79strchr.o: index.c
66 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 80 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
67 @${LD} -x -r ${.TARGET} 81 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
68 @mv a.out ${.TARGET} 82 @mv ${.TARGET}.tmp ${.TARGET}
83
84strchr.go: index.c
85 ${CC} -g -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
86 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
87 @mv ${.TARGET}.tmp ${.TARGET}
69 88
70strchr.po: index.c 89strchr.po: index.c
71 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 90 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
72 @${LD} -X -r ${.TARGET} 91 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
73 @mv a.out ${.TARGET} 92 @mv ${.TARGET}.tmp ${.TARGET}
74 93
75strchr.so: index.c 94strchr.so: index.c
76 ${CC} ${PICFLAG} -DPIC -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 95 ${CC} ${PICFLAG} -DPIC -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
@@ -82,27 +101,70 @@ strchr.so: index.c
82OBJS+= strrchr.o 101OBJS+= strrchr.o
83strrchr.o: rindex.c 102strrchr.o: rindex.c
84 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 103 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
85 @${LD} -x -r ${.TARGET} 104 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
86 @mv a.out ${.TARGET} 105 @mv ${.TARGET}.tmp ${.TARGET}
106
107strrchr.go: rindex.c
108 ${CC} -g -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
109 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
110 @mv ${.TARGET}.tmp ${.TARGET}
87 111
88strrchr.po: rindex.c 112strrchr.po: rindex.c
89 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 113 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
90 @${LD} -X -r ${.TARGET} 114 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
91 @mv a.out ${.TARGET} 115 @mv ${.TARGET}.tmp ${.TARGET}
92 116
93strrchr.so: rindex.c 117strrchr.so: rindex.c
94 ${CC} ${PICFLAG} -DPIC -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 118 ${CC} ${PICFLAG} -DPIC -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
95 -o ${.TARGET} 119 -o ${.TARGET}
96.endif 120.endif
97 121
98MAN+= bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ 122# build .ln files for memmove, memcpy, strchr and strrchr always from
99 memcmp.3 memcpy.3 memmove.3 memset.3 rindex.3 strcasecmp.3 strcat.3 \ 123# bcopy, index, and rindex
100 strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 strftime.3 \ 124LOBJS+= memmove.ln memcpy.ln strchr.ln strrchr.ln
125
126memmove.ln: bcopy.c
127 lint ${LINTFLAGS} -DMEMMOVE ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
128 ${LIBCSRCDIR}/string/bcopy.c
129
130memcpy.ln: bcopy.c
131 lint ${LINTFLAGS} -DMEMCOPY ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
132 ${LIBCSRCDIR}/string/bcopy.c
133
134strchr.ln: index.c
135 lint ${LINTFLAGS} -DSTRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
136 ${LIBCSRCDIR}/string/index.c
137
138strrchr.ln: rindex.c
139 lint ${LINTFLAGS} -DSTRRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
140 ${LIBCSRCDIR}/string/rindex.c
141
142MAN+= bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 memccpy.3 memchr.3 \
143 memcmp.3 memcpy.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \
144 strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 \
101 string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \ 145 string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \
102 strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 146 strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 strlcpy.3 \
147 wcscasecmp.3 wcscat.3 wcschr.3 wcscmp.3 wcscpy.3 wcscspn.3 wcsdup.3 \
148 wcslcpy.3 wcslen.3 wcspbrk.3 wcsrchr.3 wcsspn.3 wcsstr.3 wcstok.3 \
149 wcswidth.3 wmemchr.3 wmemcmp.3 wmemcpy.3 wmemmove.3 wmemset.3
103 150
104MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3 151MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3
152MLINKS+=memchr.3 memrchr.3
153MLINKS+=strchr.3 index.3
154MLINKS+=strrchr.3 rindex.3
105MLINKS+=strcasecmp.3 strncasecmp.3 155MLINKS+=strcasecmp.3 strncasecmp.3
106MLINKS+=strcat.3 strncat.3 156MLINKS+=strcat.3 strncat.3
107MLINKS+=strcmp.3 strncmp.3 157MLINKS+=strcmp.3 strncmp.3
108MLINKS+=strcpy.3 strncpy.3 158MLINKS+=strcpy.3 strncpy.3
159MLINKS+=strdup.3 strndup.3
160MLINKS+=strlcpy.3 strlcat.3
161MLINKS+=strlen.3 strnlen.3
162MLINKS+=strstr.3 strcasestr.3
163MLINKS+=strtok.3 strtok_r.3
164MLINKS+=strerror.3 strerror_r.3
165MLINKS+=wcscasecmp.3 wcsncasecmp.3
166MLINKS+=wcscat.3 wcsncat.3
167MLINKS+=wcscmp.3 wcsncmp.3
168MLINKS+=wcscpy.3 wcsncpy.3
169MLINKS+=wcslcpy.3 wcslcat.3
170MLINKS+=bcmp.3 timingsafe_bcmp.3