1 # from: @(#)Makefile.inc 5.6 (Berkeley) 3/5/91 2 # $Id: Makefile.inc,v 1.37 1996/11/12 02:03:13 jtc 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 .endif 44 45 # if no machine specific memcpy(3), build one out of bcopy(3). 46 # if there is a machine specific memmove(3), we'll assume it aliases 47 # memcpy(3). 48 .if empty(SRCS:Mmemcpy.S) 49 .if empty(SRCS:Mmemmove.S) 50 OBJS+= memcpy.o 51 memcpy.o: bcopy.c 52 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 53 @${LD} -x -r ${.TARGET} 54 @mv a.out ${.TARGET} 55 56 memcpy.po: bcopy.c 57 ${CC} -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 58 @${LD} -X -r ${.TARGET} 59 @mv a.out ${.TARGET} 60 61 memcpy.so: bcopy.c 62 ${CC} ${PICFLAG} -DPIC -DMEMCOPY ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 63 -o ${.TARGET} 64 .endif 65 .endif 66 67 # if no machine specific strchr(3), build one out of index(3). 68 .if empty(SRCS:Mstrchr.S) 69 OBJS+= strchr.o 70 strchr.o: index.c 71 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 72 @${LD} -x -r ${.TARGET} 73 @mv a.out ${.TARGET} 74 75 strchr.po: index.c 76 ${CC} -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 77 @${LD} -X -r ${.TARGET} 78 @mv a.out ${.TARGET} 79 80 strchr.so: index.c 81 ${CC} ${PICFLAG} -DPIC -DSTRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 82 -o ${.TARGET} 83 .endif 84 85 # if no machine specific strrchr(3), build one out of rindex(3). 86 .if empty(SRCS:Mstrrchr.S) 87 OBJS+= strrchr.o 88 strrchr.o: rindex.c 89 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} -o ${.TARGET} 90 @${LD} -x -r ${.TARGET} 91 @mv a.out ${.TARGET} 92 93 strrchr.po: rindex.c 94 ${CC} -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c -p ${.ALLSRC} -o ${.TARGET} 95 @${LD} -X -r ${.TARGET} 96 @mv a.out ${.TARGET} 97 98 strrchr.so: rindex.c 99 ${CC} ${PICFLAG} -DPIC -DSTRRCHR ${CFLAGS} ${CPPFLAGS} -c ${.ALLSRC} \ 100 -o ${.TARGET} 101 .endif 102 103 MAN+= bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ 104 memcmp.3 memcpy.3 memmove.3 memset.3 rindex.3 strcasecmp.3 strcat.3 \ 105 strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 strftime.3 \ 106 string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \ 107 strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 108 109 MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3 110 MLINKS+=strcasecmp.3 strncasecmp.3 111 MLINKS+=strcat.3 strncat.3 112 MLINKS+=strcmp.3 strncmp.3 113 MLINKS+=strcpy.3 strncpy.3 114