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