Home | History | Annotate | Line # | Download | only in string
Makefile.inc revision 1.18
      1 #	from: @(#)Makefile.inc	5.6 (Berkeley) 3/5/91
      2 #	$Id: Makefile.inc,v 1.18 1993/12/06 03:10:35 cgd Exp $
      3 
      4 # string sources
      5 .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/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_ARCH} == "m68k")
     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_ARCH} == "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_ARCH} == "ns32k")
     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_ARCH} == "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_ARCH} == "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 
     54 memmove.so: bcopy.c
     55 	${CC} ${PICFLAG} -DPIC -DMEMMOVE ${CFLAGS} -c -p ${.ALLSRC} \
     56 		-o ${.TARGET}
     57 .endif
     58 
     59 # if no machine specific memcpy(3), build one out of bcopy(3).
     60 # if there is a machine specific memmove(3), we'll assume it aliases
     61 # memcpy(3).
     62 .if empty(SRCS:Mmemcpy.S)
     63 .if empty(SRCS:Mmemmove.S)
     64 OBJS+=	memcpy.o
     65 memcpy.o: bcopy.c
     66 	${CC} -DMEMCOPY ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
     67 	@${LD} -x -r ${.TARGET}
     68 	@mv a.out ${.TARGET}
     69 
     70 memcpy.po: bcopy.c
     71 	${CC} -DMEMCOPY ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
     72 	@${LD} -X -r ${.TARGET}
     73 	@mv a.out ${.TARGET}
     74 
     75 memcpy.so: bcopy.c
     76 	${CC} ${PICFLAG} -DPIC -DMEMCOPY ${CFLAGS} -c -p ${.ALLSRC} \
     77 		-o ${.TARGET}
     78 .endif
     79 .endif
     80 
     81 # if no machine specific strchr(3), build one out of index(3).
     82 .if empty(SRCS:Mstrchr.S)
     83 OBJS+=	strchr.o
     84 strchr.o: index.c
     85 	${CC} -DSTRCHR ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
     86 	@${LD} -x -r ${.TARGET}
     87 	@mv a.out ${.TARGET}
     88 
     89 strchr.po: index.c
     90 	${CC} -DSTRCHR ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
     91 	@${LD} -X -r ${.TARGET}
     92 	@mv a.out ${.TARGET}
     93 
     94 strchr.so: index.c
     95 	${CC} ${PICFLAG} -DPIC -DSTRCHR ${CFLAGS} -c -p ${.ALLSRC} \
     96 	    -o ${.TARGET}
     97 .endif
     98 
     99 # if no machine specific strrchr(3), build one out of rindex(3).
    100 .if empty(SRCS:Mstrrchr.S)
    101 OBJS+=	strrchr.o
    102 strrchr.o: rindex.c
    103 	${CC} -DSTRRCHR ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
    104 	@${LD} -x -r ${.TARGET}
    105 	@mv a.out ${.TARGET}
    106 
    107 strrchr.po: rindex.c
    108 	${CC} -DSTRRCHR ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
    109 	@${LD} -X -r ${.TARGET}
    110 	@mv a.out ${.TARGET}
    111 
    112 strrchr.so: rindex.c
    113 	${CC} ${PICFLAG} -DPIC -DSTRRCHR ${CFLAGS} -c -p ${.ALLSRC} \
    114 	    -o ${.TARGET}
    115 .endif
    116 
    117 MAN3+=	bcmp.0 bcopy.0 bstring.0 bzero.0 ffs.0 index.0 memccpy.0 memchr.0 \
    118 	memcmp.0 memcpy.0 memmove.0 memset.0 rindex.0 strcasecmp.0 strcat.0 \
    119 	strchr.0 strcmp.0 strcoll.0 strcpy.0 strcspn.0 strerror.0 strftime.0 string.0 \
    120 	strlen.0 strmode.0 strdup.0 strpbrk.0 strrchr.0 strsep.0 strspn.0 \
    121 	strstr.0 strtok.0 strxfrm.0 swab.0
    122 
    123 MLINKS+=strcasecmp.3 strncasecmp.3
    124 MLINKS+=strcat.3 strncat.3
    125 MLINKS+=strcmp.3 strncmp.3
    126 MLINKS+=strcpy.3 strncpy.3
    127