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.inc128
1 files changed, 128 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..076db78945
--- /dev/null
+++ b/src/lib/libc/string/Makefile.inc
@@ -0,0 +1,128 @@
1# $OpenBSD: Makefile.inc,v 1.5 1998/07/01 01:29:44 millert Exp $
2
3# string sources
4.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/string ${.CURDIR}/string
5
6SRCS+= bm.c memccpy.c strcasecmp.c strcoll.c strdup.c strerror.c \
7 strlcat.c strlcpy.c strmode.c strsignal.c strtok.c strxfrm.c \
8 __strerror.c __strsignal.c
9
10# machine-dependent net sources
11# m-d Makefile.inc must include sources for:
12# bcmp() bcopy() bzero() ffs() index() memchr() memcmp() memset()
13# rindex() strcat() strcmp() strcpy() strcspn() strlen()
14# strncat() strncmp() strncpy() strpbrk() strsep()
15# strspn() strstr() swav()
16# m-d Makefile.inc may include sources for:
17# memcpy() memmove() strchr() strrchr()
18
19.include "${.CURDIR}/arch/${MACHINE_ARCH}/string/Makefile.inc"
20
21# if no machine specific memmove(3), build one out of bcopy(3).
22.if empty(SRCS:Mmemmove.S)
23OBJS+= memmove.o
24memmove.o: bcopy.c
25 ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
26 @${LD} -x -r ${.TARGET}
27 @mv a.out ${.TARGET}
28
29memmove.po: bcopy.c
30 ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
31 @${LD} -X -r ${.TARGET}
32 @mv a.out ${.TARGET}
33
34memmove.so: bcopy.c
35 ${CC} ${PICFLAG} -DPIC -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
36 -o ${.TARGET}
37.endif
38
39# if no machine specific memcpy(3), build one out of bcopy(3).
40# if there is a machine specific memmove(3), we'll assume it aliases
41# memcpy(3).
42.if empty(SRCS:Mmemcpy.S)
43.if empty(SRCS:Mmemmove.S)
44OBJS+= memcpy.o
45memcpy.o: bcopy.c
46 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
47 @${LD} -x -r ${.TARGET}
48 @mv a.out ${.TARGET}
49
50memcpy.po: bcopy.c
51 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
52 @${LD} -X -r ${.TARGET}
53 @mv a.out ${.TARGET}
54
55memcpy.so: bcopy.c
56 ${CC} ${PICFLAG} -DPIC -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
57 -o ${.TARGET}
58.endif
59.endif
60
61# if no machine specific strchr(3), build one out of index(3).
62.if empty(SRCS:Mstrchr.S)
63OBJS+= strchr.o
64strchr.o: index.c
65 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
66 @${LD} -x -r ${.TARGET}
67 @mv a.out ${.TARGET}
68
69strchr.po: index.c
70 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
71 @${LD} -X -r ${.TARGET}
72 @mv a.out ${.TARGET}
73
74strchr.so: index.c
75 ${CC} ${PICFLAG} -DPIC -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
76 -o ${.TARGET}
77.endif
78
79# if no machine specific strrchr(3), build one out of rindex(3).
80.if empty(SRCS:Mstrrchr.S)
81OBJS+= strrchr.o
82strrchr.o: rindex.c
83 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET}
84 @${LD} -x -r ${.TARGET}
85 @mv a.out ${.TARGET}
86
87strrchr.po: rindex.c
88 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
89 @${LD} -X -r ${.TARGET}
90 @mv a.out ${.TARGET}
91
92strrchr.so: rindex.c
93 ${CC} ${PICFLAG} -DPIC -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \
94 -o ${.TARGET}
95.endif
96
97# build .ln files for memmove, memcpy, strchr and strrchr always from
98# bcopy, index, and rindex
99LOBJS+= memmove.ln memcpy.ln strchr.ln strrchr.ln
100
101memmove.ln: bcopy.c
102 lint ${LINTFLAGS} -DMEMMOVE ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
103 ${.CURDIR}/string/bcopy.c
104
105memcpy.ln: bcopy.c
106 lint ${LINTFLAGS} -DMEMCOPY ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
107 ${.CURDIR}/string/bcopy.c
108
109strchr.ln: index.c
110 lint ${LINTFLAGS} -DSTRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
111 ${.CURDIR}/string/index.c
112
113strrchr.ln: rindex.c
114 lint ${LINTFLAGS} -DSTRRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \
115 ${.CURDIR}/string/rindex.c
116
117MAN+= bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \
118 memcmp.3 memcpy.3 memmove.3 memset.3 rindex.3 strcasecmp.3 strcat.3 \
119 strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 \
120 string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \
121 strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 strlcpy.3
122
123MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3
124MLINKS+=strcasecmp.3 strncasecmp.3
125MLINKS+=strcat.3 strncat.3
126MLINKS+=strcmp.3 strncmp.3
127MLINKS+=strcpy.3 strncpy.3
128MLINKS+=strlcpy.3 strlcat.3