diff options
Diffstat (limited to 'src/lib/libc/string/Makefile.inc')
| -rw-r--r-- | src/lib/libc/string/Makefile.inc | 178 |
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 | |||
| 6 | SRCS+= 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) | ||
| 27 | OBJS+= memmove.o | ||
| 28 | memmove.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 | |||
| 33 | memmove.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 | |||
| 38 | memmove.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 | |||
| 43 | memmove.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) | ||
| 53 | OBJS+= memcpy.o | ||
| 54 | memcpy.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 | |||
| 59 | memcpy.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 | |||
| 64 | memcpy.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 | |||
| 69 | memcpy.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) | ||
| 77 | OBJS+= strchr.o | ||
| 78 | strchr.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 | |||
| 83 | strchr.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 | |||
| 88 | strchr.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 | |||
| 93 | strchr.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) | ||
| 100 | OBJS+= strrchr.o | ||
| 101 | strrchr.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 | |||
| 106 | strrchr.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 | |||
| 111 | strrchr.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 | |||
| 116 | strrchr.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 | ||
| 123 | LOBJS+= memmove.ln memcpy.ln strchr.ln strrchr.ln | ||
| 124 | |||
| 125 | memmove.ln: bcopy.c | ||
| 126 | lint ${LINTFLAGS} -DMEMMOVE ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
| 127 | ${LIBCSRCDIR}/string/bcopy.c | ||
| 128 | |||
| 129 | memcpy.ln: bcopy.c | ||
| 130 | lint ${LINTFLAGS} -DMEMCOPY ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
| 131 | ${LIBCSRCDIR}/string/bcopy.c | ||
| 132 | |||
| 133 | strchr.ln: index.c | ||
| 134 | lint ${LINTFLAGS} -DSTRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
| 135 | ${LIBCSRCDIR}/string/index.c | ||
| 136 | |||
| 137 | strrchr.ln: rindex.c | ||
| 138 | lint ${LINTFLAGS} -DSTRRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ | ||
| 139 | ${LIBCSRCDIR}/string/rindex.c | ||
| 140 | |||
| 141 | MAN+= 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 | |||
| 148 | MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3 | ||
| 149 | MLINKS+=memchr.3 memrchr.3 | ||
| 150 | MLINKS+=strchr.3 index.3 | ||
| 151 | MLINKS+=strrchr.3 rindex.3 | ||
| 152 | MLINKS+=strcasecmp.3 strncasecmp.3 | ||
| 153 | MLINKS+=strcat.3 strncat.3 | ||
| 154 | MLINKS+=strcmp.3 strncmp.3 | ||
| 155 | MLINKS+=strcpy.3 strncpy.3 | ||
| 156 | MLINKS+=strlcpy.3 strlcat.3 | ||
| 157 | MLINKS+=strstr.3 strcasestr.3 | ||
| 158 | MLINKS+=strtok.3 strtok_r.3 | ||
| 159 | MLINKS+=strerror.3 strerror_r.3 | ||
| 160 | MLINKS+=wmemchr.3 wmemcmp.3 | ||
| 161 | MLINKS+=wmemchr.3 wmemcpy.3 | ||
| 162 | MLINKS+=wmemchr.3 wmemmove.3 | ||
| 163 | MLINKS+=wmemchr.3 wmemset.3 | ||
| 164 | MLINKS+=wmemchr.3 wcscat.3 | ||
| 165 | MLINKS+=wmemchr.3 wcschr.3 | ||
| 166 | MLINKS+=wmemchr.3 wcscmp.3 | ||
| 167 | MLINKS+=wmemchr.3 wcscpy.3 | ||
| 168 | MLINKS+=wmemchr.3 wcscspn.3 | ||
| 169 | MLINKS+=wmemchr.3 wcslcat.3 | ||
| 170 | MLINKS+=wmemchr.3 wcslcpy.3 | ||
| 171 | MLINKS+=wmemchr.3 wcslen.3 | ||
| 172 | MLINKS+=wmemchr.3 wcsncat.3 | ||
| 173 | MLINKS+=wmemchr.3 wcsncmp.3 | ||
| 174 | MLINKS+=wmemchr.3 wcsncpy.3 | ||
| 175 | MLINKS+=wmemchr.3 wcspbrk.3 | ||
| 176 | MLINKS+=wmemchr.3 wcsrchr.3 | ||
| 177 | MLINKS+=wmemchr.3 wcsspn.3 | ||
| 178 | MLINKS+=wmemchr.3 wcsstr.3 | ||
