Home | History | Annotate | Line # | Download | only in string
Makefile.inc revision 1.9
      1 #	from: @(#)Makefile.inc	5.6 (Berkeley) 3/5/91
      2 #	$Id: Makefile.inc,v 1.9 1993/08/01 05:40:37 mycroft Exp $
      3 
      4 # string sources
      5 .PATH: ${.CURDIR}/${MACHINE}/string ${.CURDIR}/string
      6 
      7 SRCS+=	memccpy.c strcasecmp.c strcoll.c strdup.c \
      8 	strftime.c strmode.c strtok.c strxfrm.c swab.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
     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
     20 SRCS+=	memmove.s strchr.s strrchr.s
     21 .elif (${MACHINE} == "tahoe")
     22 SRCS+=	bcmp.s bcopy.s bzero.s ffs.s index.c memchr.c memcmp.s memset.c \
     23 	rindex.c strcat.s strcmp.s strcpy.s strcspn.c strlen.s \
     24 	strncat.s strncmp.s strncpy.s strpbrk.c strsep.c \
     25 	strspn.c strstr.c
     26 SRCS+=	memmove.s
     27 .elif (${MACHINE} == "vax")
     28 SRCS+=	bcmp.s bcopy.s bzero.s ffs.s index.c memchr.s memcmp.s memset.s \
     29 	rindex.s strcat.s strcmp.s strcpy.s strcspn.s strlen.s \
     30 	strncat.s strncmp.s strncpy.s strpbrk.s strsep.s \
     31 	strspn.s strstr.s
     32 SRCS+=	memmove.s strchr.s strrchr.s
     33 .endif
     34 
     35 # if no machine specific memmove(3), build one out of bcopy(3).
     36 .if empty(SRCS:Mmemmove.s)
     37 OBJS+=	memmove.o
     38 memmove.o: bcopy.c
     39 	${CC} -DMEMMOVE ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
     40 	@${LD} -x -r ${.TARGET}
     41 	@mv a.out ${.TARGET}
     42 
     43 memmove.po: bcopy.c
     44 	${CC} -DMEMMOVE ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
     45 	@${LD} -X -r ${.TARGET}
     46 	@mv a.out ${.TARGET}
     47 .endif
     48 
     49 # if no machine specific memcpy(3), build one out of bcopy(3).
     50 # if there is a machine specific memmove(3), we'll assume it aliases
     51 # memcpy(3).
     52 .if empty(SRCS:Mmemcpy.s)
     53 .if empty(SRCS:Mmemmove.s)
     54 OBJS+=	memcpy.o
     55 memcpy.o: bcopy.c
     56 	${CC} -DMEMCOPY ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
     57 	@${LD} -x -r ${.TARGET}
     58 	@mv a.out ${.TARGET}
     59 
     60 memcpy.po: bcopy.c
     61 	${CC} -DMEMCOPY ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
     62 	@${LD} -X -r ${.TARGET}
     63 	@mv a.out ${.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} -c ${.ALLSRC} -o ${.TARGET}
     72 	@${LD} -x -r ${.TARGET}
     73 	@mv a.out ${.TARGET}
     74 
     75 strchr.po: index.c
     76 	${CC} -DSTRCHR ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
     77 	@${LD} -X -r ${.TARGET}
     78 	@mv a.out ${.TARGET}
     79 .endif
     80 
     81 # if no machine specific strrchr(3), build one out of rindex(3).
     82 .if empty(SRCS:Mstrrchr.s)
     83 OBJS+=	strrchr.o
     84 strrchr.o: rindex.c
     85 	${CC} -DSTRRCHR ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
     86 	@${LD} -x -r ${.TARGET}
     87 	@mv a.out ${.TARGET}
     88 
     89 strrchr.po: rindex.c
     90 	${CC} -DSTRRCHR ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
     91 	@${LD} -X -r ${.TARGET}
     92 	@mv a.out ${.TARGET}
     93 .endif
     94 
     95 MAN3+=	bcmp.0 bcopy.0 bstring.0 bzero.0 ffs.0 index.0 memccpy.0 memchr.0 \
     96 	memcmp.0 memcpy.0 memmove.0 memset.0 rindex.0 strcasecmp.0 strcat.0 \
     97 	strchr.0 strcmp.0 strcoll.0 strcpy.0 strcspn.0 strftime.0 string.0 \
     98 	strlen.0 strmode.0 strdup.0 strpbrk.0 strrchr.0 strsep.0 strspn.0 \
     99 	strstr.0 strtok.0 strxfrm.0 swab.0
    100 
    101 MLINKS+=strcasecmp.3 strncasecmp.3
    102 MLINKS+=strcat.3 strncat.3
    103 MLINKS+=strcmp.3 strncmp.3
    104 MLINKS+=strcpy.3 strncpy.3
    105