summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/Makefile.inc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libc/string/Makefile.inc178
1 files changed, 178 insertions, 0 deletions
diff --git a/src/lib/libc/string/Makefile.inc b/src/lib/libc/string/Makefile.inc
new file mode 100644
index 0000000000..124469cd3a
--- /dev/null
+++ b/src/lib/libc/string/Makefile.inc
@@ -0,0 +1,178 @@
1# $OpenBSD: Makefile.inc,v 1.20 2007/10/25 22:41:02 miod Exp $
2
3# string sources
4.PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/string ${LIBCSRCDIR}/string
5
6SRCS+= bm.c memccpy.c memrchr.c strcasecmp.c strcasestr.c strcoll.c strdup.c \
7 strerror.c strerror_r.c strlcat.c strmode.c strsignal.c strtok.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
13
14# machine-dependent net sources
15# m-d Makefile.inc must include sources for:
16# bcmp() bcopy() bzero() ffs() index() memchr() memcmp() memset()
17# rindex() strcat() strcmp() strcpy() strcspn() strlen() strlcpy()
18# strncat() strncmp() strncpy() strpbrk() strsep()
19# strspn() strstr() swav()
20# m-d Makefile.inc may include sources for:
21# memcpy() memmove() strchr() strrchr()
22
23.include "${LIBCSRCDIR}/arch/${MACHINE_ARCH}/string/Makefile.inc"
24
25# if no machine specific memmove(3), build one out of bcopy(3).
26.if empty(SRCS:Mmemmove.S)
27OBJS+= memmove.o
28memmove.o: bcopy.c
29 ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
30 @${LD} -o ${.TARGET}.tmp -x -r ${.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}
37
38memmove.po: bcopy.c
39 ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
40 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
41 @mv ${.TARGET}.tmp ${.TARGET}
42
43memmove.so: bcopy.c
44 ${CC} ${PICFLAG} -DPIC -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
45 -o ${.TARGET}
46.endif
47
48# if no machine specific memcpy(3), build one out of bcopy(3).
49# if there is a machine specific memmove(3), we'll assume it aliases
50# memcpy(3).
51.if empty(SRCS:Mmemcpy.S)
52.if empty(SRCS:Mmemmove.S)
53OBJS+= memcpy.o
54memcpy.o: bcopy.c
55 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
56 @${LD} -o ${.TARGET}.tmp -x -r ${.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}
63
64memcpy.po: bcopy.c
65 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
66 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
67 @mv ${.TARGET}.tmp ${.TARGET}
68
69memcpy.so: bcopy.c
70 ${CC} ${PICFLAG} -DPIC -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
71 -o ${.TARGET}
72.endif
73.endif
74
75# if no machine specific strchr(3), build one out of index(3).
76.if empty(SRCS:Mstrchr.S)
77OBJS+= strchr.o
78strchr.o: index.c
79 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
80 @${LD} -o ${.TARGET}.tmp -x -r ${.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}
87
88strchr.po: index.c
89 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
90 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
91 @mv ${.TARGET}.tmp ${.TARGET}
92
93strchr.so: index.c
94 ${CC} ${PICFLAG} -DPIC -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
95 -o ${.TARGET}
96.endif
97
98# if no machine specific strrchr(3), build one out of rindex(3).
99.if empty(SRCS:Mstrrchr.S)
100OBJS+= strrchr.o
101strrchr.o: rindex.c
102 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
103 @${LD} -o ${.TARGET}.tmp -x -r ${.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}
110
111strrchr.po: rindex.c
112 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
113 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
114 @mv ${.TARGET}.tmp ${.TARGET}
115
116strrchr.so: rindex.c
117 ${CC} ${PICFLAG} -DPIC -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
118 -o ${.TARGET}
119.endif
120
121# build .ln files for memmove, memcpy, strchr and strrchr always from
122# bcopy, index, and rindex
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 \
144 string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \
145 strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 strlcpy.3 \
146 wcstok.3 wmemchr.3
147
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
152MLINKS+=strcasecmp.3 strncasecmp.3
153MLINKS+=strcat.3 strncat.3
154MLINKS+=strcmp.3 strncmp.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