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