diff options
Diffstat (limited to 'src/lib/libc/string/Makefile.inc')
-rw-r--r-- | src/lib/libc/string/Makefile.inc | 128 |
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 | |||
6 | SRCS+= 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) | ||
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.po: bcopy.c | ||
30 | ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} | ||
31 | @${LD} -X -r ${.TARGET} | ||
32 | @mv a.out ${.TARGET} | ||
33 | |||
34 | memmove.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) | ||
44 | OBJS+= memcpy.o | ||
45 | memcpy.o: bcopy.c | ||
46 | ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
47 | @${LD} -x -r ${.TARGET} | ||
48 | @mv a.out ${.TARGET} | ||
49 | |||
50 | memcpy.po: bcopy.c | ||
51 | ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} | ||
52 | @${LD} -X -r ${.TARGET} | ||
53 | @mv a.out ${.TARGET} | ||
54 | |||
55 | memcpy.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) | ||
63 | OBJS+= strchr.o | ||
64 | strchr.o: index.c | ||
65 | ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
66 | @${LD} -x -r ${.TARGET} | ||
67 | @mv a.out ${.TARGET} | ||
68 | |||
69 | strchr.po: index.c | ||
70 | ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} | ||
71 | @${LD} -X -r ${.TARGET} | ||
72 | @mv a.out ${.TARGET} | ||
73 | |||
74 | strchr.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) | ||
81 | OBJS+= strrchr.o | ||
82 | strrchr.o: rindex.c | ||
83 | ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} | ||
84 | @${LD} -x -r ${.TARGET} | ||
85 | @mv a.out ${.TARGET} | ||
86 | |||
87 | strrchr.po: rindex.c | ||
88 | ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} | ||
89 | @${LD} -X -r ${.TARGET} | ||
90 | @mv a.out ${.TARGET} | ||
91 | |||
92 | strrchr.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 | ||
99 | LOBJS+= memmove.ln memcpy.ln strchr.ln strrchr.ln | ||
100 | |||
101 | memmove.ln: bcopy.c | ||
102 | lint ${LINTFLAGS} -DMEMMOVE ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
103 | ${.CURDIR}/string/bcopy.c | ||
104 | |||
105 | memcpy.ln: bcopy.c | ||
106 | lint ${LINTFLAGS} -DMEMCOPY ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
107 | ${.CURDIR}/string/bcopy.c | ||
108 | |||
109 | strchr.ln: index.c | ||
110 | lint ${LINTFLAGS} -DSTRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
111 | ${.CURDIR}/string/index.c | ||
112 | |||
113 | strrchr.ln: rindex.c | ||
114 | lint ${LINTFLAGS} -DSTRRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
115 | ${.CURDIR}/string/rindex.c | ||
116 | |||
117 | MAN+= 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 | |||
123 | MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3 | ||
124 | MLINKS+=strcasecmp.3 strncasecmp.3 | ||
125 | MLINKS+=strcat.3 strncat.3 | ||
126 | MLINKS+=strcmp.3 strncmp.3 | ||
127 | MLINKS+=strcpy.3 strncpy.3 | ||
128 | MLINKS+=strlcpy.3 strlcat.3 | ||