diff options
Diffstat (limited to 'src/lib/libc/string/Makefile.inc')
-rw-r--r-- | src/lib/libc/string/Makefile.inc | 152 |
1 files changed, 152 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..26e2bc10f2 --- /dev/null +++ b/src/lib/libc/string/Makefile.inc | |||
@@ -0,0 +1,152 @@ | |||
1 | # $OpenBSD: Makefile.inc,v 1.12 2003/02/20 03:20:09 deraadt Exp $ | ||
2 | |||
3 | # string sources | ||
4 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/string ${LIBCSRCDIR}/string | ||
5 | |||
6 | SRCS+= bm.c memccpy.c strcasecmp.c strcoll.c strdup.c strerror.c \ | ||
7 | strerror_r.c strlcat.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() strlcpy() | ||
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 "${LIBCSRCDIR}/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) | ||
23 | OBJS+= memmove.o | ||
24 | memmove.o: bcopy.c | ||
25 | ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
26 | @${LD} -x -r ${.TARGET} | ||
27 | @mv a.out ${.TARGET} | ||
28 | |||
29 | memmove.go: bcopy.c | ||
30 | ${CC} -g -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
31 | @${LD} -x -r ${.TARGET} | ||
32 | @mv a.out ${.TARGET} | ||
33 | |||
34 | memmove.po: bcopy.c | ||
35 | ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} | ||
36 | @${LD} -X -r ${.TARGET} | ||
37 | @mv a.out ${.TARGET} | ||
38 | |||
39 | memmove.so: bcopy.c | ||
40 | ${CC} ${PICFLAG} -DPIC -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ | ||
41 | -o ${.TARGET} | ||
42 | .endif | ||
43 | |||
44 | # if no machine specific memcpy(3), build one out of bcopy(3). | ||
45 | # if there is a machine specific memmove(3), we'll assume it aliases | ||
46 | # memcpy(3). | ||
47 | .if empty(SRCS:Mmemcpy.S) | ||
48 | .if empty(SRCS:Mmemmove.S) | ||
49 | OBJS+= memcpy.o | ||
50 | memcpy.o: bcopy.c | ||
51 | ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
52 | @${LD} -x -r ${.TARGET} | ||
53 | @mv a.out ${.TARGET} | ||
54 | |||
55 | memcpy.go: bcopy.c | ||
56 | ${CC} -g -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
57 | @${LD} -x -r ${.TARGET} | ||
58 | @mv a.out ${.TARGET} | ||
59 | |||
60 | memcpy.po: bcopy.c | ||
61 | ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} | ||
62 | @${LD} -X -r ${.TARGET} | ||
63 | @mv a.out ${.TARGET} | ||
64 | |||
65 | memcpy.so: bcopy.c | ||
66 | ${CC} ${PICFLAG} -DPIC -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ | ||
67 | -o ${.TARGET} | ||
68 | .endif | ||
69 | .endif | ||
70 | |||
71 | # if no machine specific strchr(3), build one out of index(3). | ||
72 | .if empty(SRCS:Mstrchr.S) | ||
73 | OBJS+= strchr.o | ||
74 | strchr.o: index.c | ||
75 | ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
76 | @${LD} -x -r ${.TARGET} | ||
77 | @mv a.out ${.TARGET} | ||
78 | |||
79 | strchr.go: index.c | ||
80 | ${CC} -g -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
81 | @${LD} -x -r ${.TARGET} | ||
82 | @mv a.out ${.TARGET} | ||
83 | |||
84 | strchr.po: index.c | ||
85 | ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} | ||
86 | @${LD} -X -r ${.TARGET} | ||
87 | @mv a.out ${.TARGET} | ||
88 | |||
89 | strchr.so: index.c | ||
90 | ${CC} ${PICFLAG} -DPIC -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ | ||
91 | -o ${.TARGET} | ||
92 | .endif | ||
93 | |||
94 | # if no machine specific strrchr(3), build one out of rindex(3). | ||
95 | .if empty(SRCS:Mstrrchr.S) | ||
96 | OBJS+= strrchr.o | ||
97 | strrchr.o: rindex.c | ||
98 | ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
99 | @${LD} -x -r ${.TARGET} | ||
100 | @mv a.out ${.TARGET} | ||
101 | |||
102 | strrchr.go: rindex.c | ||
103 | ${CC} -g -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
104 | @${LD} -x -r ${.TARGET} | ||
105 | @mv a.out ${.TARGET} | ||
106 | |||
107 | strrchr.po: rindex.c | ||
108 | ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} | ||
109 | @${LD} -X -r ${.TARGET} | ||
110 | @mv a.out ${.TARGET} | ||
111 | |||
112 | strrchr.so: rindex.c | ||
113 | ${CC} ${PICFLAG} -DPIC -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ | ||
114 | -o ${.TARGET} | ||
115 | .endif | ||
116 | |||
117 | # build .ln files for memmove, memcpy, strchr and strrchr always from | ||
118 | # bcopy, index, and rindex | ||
119 | LOBJS+= memmove.ln memcpy.ln strchr.ln strrchr.ln | ||
120 | |||
121 | memmove.ln: bcopy.c | ||
122 | lint ${LINTFLAGS} -DMEMMOVE ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
123 | ${LIBCSRCDIR}/string/bcopy.c | ||
124 | |||
125 | memcpy.ln: bcopy.c | ||
126 | lint ${LINTFLAGS} -DMEMCOPY ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
127 | ${LIBCSRCDIR}/string/bcopy.c | ||
128 | |||
129 | strchr.ln: index.c | ||
130 | lint ${LINTFLAGS} -DSTRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
131 | ${LIBCSRCDIR}/string/index.c | ||
132 | |||
133 | strrchr.ln: rindex.c | ||
134 | lint ${LINTFLAGS} -DSTRRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
135 | ${LIBCSRCDIR}/string/rindex.c | ||
136 | |||
137 | MAN+= bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 memccpy.3 memchr.3 \ | ||
138 | memcmp.3 memcpy.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ | ||
139 | strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 \ | ||
140 | string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \ | ||
141 | strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 strlcpy.3 | ||
142 | |||
143 | MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3 | ||
144 | MLINKS+=strchr.3 index.3 | ||
145 | MLINKS+=strrchr.3 rindex.3 | ||
146 | MLINKS+=strcasecmp.3 strncasecmp.3 | ||
147 | MLINKS+=strcat.3 strncat.3 | ||
148 | MLINKS+=strcmp.3 strncmp.3 | ||
149 | MLINKS+=strcpy.3 strncpy.3 | ||
150 | MLINKS+=strlcpy.3 strlcat.3 | ||
151 | MLINKS+=strtok.3 strtok_r.3 | ||
152 | MLINKS+=strerror.3 strerror_r.3 | ||