1 # from: @(#)Makefile.inc 5.6 (Berkeley) 3/5/91 2 # $Id: Makefile.inc,v 1.32 1994/12/22 10:15:00 cgd Exp $ 3 4 # string sources 5 .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/string ${.CURDIR}/string 6 7 SRCS+= bm.c memccpy.c strcasecmp.c strcoll.c strdup.c strerror.c \ 8 strftime.c strmode.c strsignal.c strtok.c strxfrm.c \ 9 __strerror.c __strsignal.c 10 11 .if (${MACHINE_ARCH} == "m68k") 12 SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.S memchr.c memcmp.S memset.S \ 13 rindex.S strcat.c strcmp.S strcpy.S strcspn.c strlen.S \ 14 strncat.c strncmp.S strncpy.S strpbrk.c strsep.c \ 15 strspn.c strstr.c swab.S 16 SRCS+= memcpy.S memmove.S strchr.S strrchr.S 17 .elif (${MACHINE_ARCH} == "i386") 18 SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.S memchr.S memcmp.S memset.S \ 19 rindex.S strcat.S strcmp.S strcpy.S strcspn.c strlen.S \ 20 strncat.c strncmp.S strncpy.c strpbrk.c strsep.c \ 21 strspn.c strstr.c swab.S 22 SRCS+= memcpy.S memmove.S strchr.S strrchr.S 23 .elif (${MACHINE_ARCH} == "ns32k") 24 SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memchr.c memcmp.c memset.c \ 25 rindex.c strcat.c strcmp.c strcpy.c strcspn.c strlen.c \ 26 strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \ 27 strspn.c strstr.c swab.c 28 #SRCS+= memmove.c strchr.c strrchr.c 29 .elif (${MACHINE_ARCH} == "tahoe") 30 SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.c memchr.c memcmp.S memset.c \ 31 rindex.c strcat.S strcmp.S strcpy.S strcspn.c strlen.S \ 32 strncat.S strncmp.S strncpy.S strpbrk.c strsep.c \ 33 strspn.c strstr.c swab.c 34 SRCS+= memmove.S 35 .elif (${MACHINE_ARCH} == "vax") 36 SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.c memchr.S memcmp.S memset.S \ 37 rindex.S strcat.S strcmp.S strcpy.S strcspn.S strlen.S \ 38 strncat.S strncmp.S strncpy.S strpbrk.S strsep.S \ 39 strspn.S strstr.S swab.c 40 SRCS+= memmove.S strchr.S strrchr.S 41 .elif (${MACHINE_ARCH} == "sparc") 42 SRCS+= bcmp.c bcopy.c bzero.S ffs.S index.c memchr.c memcmp.c memset.c \ 43 rindex.c strcat.c strcmp.c strcpy.c strcspn.c strlen.S \ 44 strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \ 45 strspn.c strstr.c swab.c 46 .elif (${MACHINE_ARCH} == "mips") 47 SRCS+= bcmp.S bcopy.S bzero.S ffs.S index.S memchr.c memcmp.c memset.c \ 48 rindex.S strcat.c strcmp.S strcpy.c strcspn.c strlen.S \ 49 strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \ 50 strspn.c strstr.c swab.c 51 .endif 52 53 # if no machine specific memmove(3), build one out of bcopy(3). 54 .if empty(SRCS:Mmemmove.S) 55 OBJS+= memmove.o 56 memmove.o: bcopy.c 57 ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 58 @${LD} -x -r ${.TARGET} 59 @mv a.out ${.TARGET} 60 61 memmove.po: bcopy.c 62 ${CC} -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 63 @${LD} -X -r ${.TARGET} 64 @mv a.out ${.TARGET} 65 66 memmove.so: bcopy.c 67 ${CC} ${PICFLAG} -DPIC -DMEMMOVE ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 68 -o ${.TARGET} 69 .endif 70 71 # if no machine specific memcpy(3), build one out of bcopy(3). 72 # if there is a machine specific memmove(3), we'll assume it aliases 73 # memcpy(3). 74 .if empty(SRCS:Mmemcpy.S) 75 .if empty(SRCS:Mmemmove.S) 76 OBJS+= memcpy.o 77 memcpy.o: bcopy.c 78 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 79 @${LD} -x -r ${.TARGET} 80 @mv a.out ${.TARGET} 81 82 memcpy.po: bcopy.c 83 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 84 @${LD} -X -r ${.TARGET} 85 @mv a.out ${.TARGET} 86 87 memcpy.so: bcopy.c 88 ${CC} ${PICFLAG} -DPIC -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 89 -o ${.TARGET} 90 .endif 91 .endif 92 93 # if no machine specific strchr(3), build one out of index(3). 94 .if empty(SRCS:Mstrchr.S) 95 OBJS+= strchr.o 96 strchr.o: index.c 97 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 98 @${LD} -x -r ${.TARGET} 99 @mv a.out ${.TARGET} 100 101 strchr.po: index.c 102 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 103 @${LD} -X -r ${.TARGET} 104 @mv a.out ${.TARGET} 105 106 strchr.so: index.c 107 ${CC} ${PICFLAG} -DPIC -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 108 -o ${.TARGET} 109 .endif 110 111 # if no machine specific strrchr(3), build one out of rindex(3). 112 .if empty(SRCS:Mstrrchr.S) 113 OBJS+= strrchr.o 114 strrchr.o: rindex.c 115 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 116 @${LD} -x -r ${.TARGET} 117 @mv a.out ${.TARGET} 118 119 strrchr.po: rindex.c 120 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 121 @${LD} -X -r ${.TARGET} 122 @mv a.out ${.TARGET} 123 124 strrchr.so: rindex.c 125 ${CC} ${PICFLAG} -DPIC -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 126 -o ${.TARGET} 127 .endif 128 129 MAN+= bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ 130 memcmp.3 memcpy.3 memmove.3 memset.3 rindex.3 strcasecmp.3 strcat.3 \ 131 strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 strftime.3 \ 132 string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \ 133 strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 134 135 MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3 136 MLINKS+=strcasecmp.3 strncasecmp.3 137 MLINKS+=strcat.3 strncat.3 138 MLINKS+=strcmp.3 strncmp.3 139 MLINKS+=strcpy.3 strncpy.3 140