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