1 # @(#)Makefile.inc 5.6 (Berkeley) 3/5/91 2 3 # string sources 4 .PATH: ${.CURDIR}/${MACHINE}/string ${.CURDIR}/string 5 6 SRCS+= memccpy.c strcasecmp.c strcoll.c strdup.c \ 7 strftime.c strmode.c strtok.c strxfrm.c swab.c 8 9 .if (${MACHINE} == "hp300") 10 SRCS+= bcmp.s bcopy.s bzero.s ffs.s index.s memchr.c memcmp.c memset.c \ 11 rindex.s strcat.c strcmp.s strcpy.s strcspn.c strlen.s \ 12 strncat.c strncmp.s strncpy.s strpbrk.c strsep.c \ 13 strspn.c strstr.c 14 .elif (${MACHINE} == "i386") 15 SRCS+= bcmp.s bcopy.s bzero.s ffs.s index.s memchr.s memcmp.s memset.s \ 16 rindex.s strcat.s strcmp.s strcpy.s strcspn.c strlen.s \ 17 strncat.c strncmp.s strncpy.c strpbrk.c strsep.c \ 18 strspn.c strstr.c 19 SRCS+= memmove.s strchr.s strrchr.s 20 .elif (${MACHINE} == "tahoe") 21 SRCS+= bcmp.s bcopy.s bzero.s ffs.s index.c memchr.c memcmp.s memset.c \ 22 rindex.c strcat.s strcmp.s strcpy.s strcspn.c strlen.s \ 23 strncat.s strncmp.s strncpy.s strpbrk.c strsep.c \ 24 strspn.c strstr.c 25 SRCS+= memmove.s 26 .elif (${MACHINE} == "vax") 27 SRCS+= bcmp.s bcopy.s bzero.s ffs.s index.c memchr.s memcmp.s memset.s \ 28 rindex.s strcat.s strcmp.s strcpy.s strcspn.s strlen.s \ 29 strncat.s strncmp.s strncpy.s strpbrk.s strsep.s \ 30 strspn.s strstr.s 31 SRCS+= memmove.s strchr.s strrchr.s 32 .endif 33 34 # if no machine specific memmove(3), build one out of bcopy(3). 35 .if empty(SRCS:Mmemmove.s) 36 OBJS+= memmove.o 37 memmove.o: bcopy.c 38 ${CC} -DMEMMOVE ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET} 39 @${LD} -x -r ${.TARGET} 40 @mv a.out ${.TARGET} 41 42 memmove.po: bcopy.c 43 ${CC} -DMEMMOVE ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 44 @${LD} -X -r ${.TARGET} 45 @mv a.out ${.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} -c ${.ALLSRC} -o ${.TARGET} 56 @${LD} -x -r ${.TARGET} 57 @mv a.out ${.TARGET} 58 59 memcpy.po: bcopy.c 60 ${CC} -DMEMCOPY ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 61 @${LD} -X -r ${.TARGET} 62 @mv a.out ${.TARGET} 63 .endif 64 .endif 65 66 # if no machine specific strchr(3), build one out of index(3). 67 .if empty(SRCS:Mstrchr.s) 68 OBJS+= strchr.o 69 strchr.o: index.c 70 ${CC} -DSTRCHR ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET} 71 @${LD} -x -r ${.TARGET} 72 @mv a.out ${.TARGET} 73 74 strchr.po: index.c 75 ${CC} -DSTRCHR ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 76 @${LD} -X -r ${.TARGET} 77 @mv a.out ${.TARGET} 78 .endif 79 80 # if no machine specific strrchr(3), build one out of rindex(3). 81 .if empty(SRCS:Mstrrchr.s) 82 OBJS+= strrchr.o 83 strrchr.o: rindex.c 84 ${CC} -DSTRRCHR ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET} 85 @${LD} -x -r ${.TARGET} 86 @mv a.out ${.TARGET} 87 88 strrchr.po: rindex.c 89 ${CC} -DSTRRCHR ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 90 @${LD} -X -r ${.TARGET} 91 @mv a.out ${.TARGET} 92 .endif 93 94 MAN3+= bcmp.0 bcopy.0 bstring.0 bzero.0 ffs.0 index.0 memccpy.0 memchr.0 \ 95 memcmp.0 memcpy.0 memmove.0 memset.0 rindex.0 strcasecmp.0 strcat.0 \ 96 strchr.0 strcmp.0 strcoll.0 strcpy.0 strcspn.0 strftime.0 string.0 \ 97 strlen.0 strmode.0 strdup.0 strpbrk.0 strrchr.0 strsep.0 strspn.0 \ 98 strstr.0 strtok.0 strxfrm.0 swab.0 99 100 MLINKS+=strcasecmp.3 strncasecmp.3 101 MLINKS+=strcat.3 strncat.3 102 MLINKS+=strcmp.3 strncmp.3 103 MLINKS+=strcpy.3 strncpy.3 104