Home | History | Annotate | Line # | Download | only in string
Makefile.inc revision 1.41
      1 #	from: @(#)Makefile.inc	5.6 (Berkeley) 3/5/91
      2 #	$NetBSD: Makefile.inc,v 1.41 1997/10/22 23:14:27 lukem 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 	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 	${COMPILE.c} -DMEMMOVE ${.ALLSRC} -o ${.TARGET}
     32 	@${LD} -x -r ${.TARGET}
     33 	@mv a.out ${.TARGET}
     34 
     35 memmove.po: bcopy.c
     36 	${COMPILE.c} -DMEMMOVE -p ${.ALLSRC} -o ${.TARGET}
     37 	@${LD} -X -r ${.TARGET}
     38 	@mv a.out ${.TARGET}
     39 
     40 memmove.so: bcopy.c
     41 	${COMPILE.c} ${PICFLAG} -DPIC -DMEMMOVE ${.ALLSRC} -o ${.TARGET}
     42 
     43 LOBJS+= memmove.ln
     44 memmove.ln: bcopy.c
     45 	${LINT} -DMEMMOVE ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
     46 	    ${.ALLSRC}
     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 	${COMPILE.c} -DMEMCOPY ${.ALLSRC} -o ${.TARGET}
     57 	@${LD} -x -r ${.TARGET}
     58 	@mv a.out ${.TARGET}
     59 
     60 memcpy.po: bcopy.c
     61 	${COMPILE.c} -DMEMCOPY -p ${.ALLSRC} -o ${.TARGET}
     62 	@${LD} -X -r ${.TARGET}
     63 	@mv a.out ${.TARGET}
     64 
     65 memcpy.so: bcopy.c
     66 	${COMPILE.c} ${PICFLAG} -DPIC -DMEMCOPY ${.ALLSRC} -o ${.TARGET}
     67 
     68 LOBJS+= memcpy.ln
     69 memcpy.ln: bcopy.c
     70 	${LINT} -DMEMCOPY ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
     71 	    ${.ALLSRC}
     72 .endif
     73 .endif
     74 
     75 # if no machine specific strchr(3), build one out of index(3).
     76 .if empty(SRCS:Mstrchr.S)
     77 OBJS+=	strchr.o
     78 strchr.o: index.c
     79 	${COMPILE.c} -DSTRCHR ${.ALLSRC} -o ${.TARGET}
     80 	@${LD} -x -r ${.TARGET}
     81 	@mv a.out ${.TARGET}
     82 
     83 strchr.po: index.c
     84 	${COMPILE.c} -DSTRCHR -p ${.ALLSRC} -o ${.TARGET}
     85 	@${LD} -X -r ${.TARGET}
     86 	@mv a.out ${.TARGET}
     87 
     88 strchr.so: index.c
     89 	${COMPILE.c} ${PICFLAG} -DPIC -DSTRCHR ${.ALLSRC} -o ${.TARGET}
     90 
     91 LOBJS+= strchr.ln
     92 strchr.ln: index.c
     93 	${LINT} -DSTRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
     94 	    ${.ALLSRC}
     95 .endif
     96 
     97 # if no machine specific strrchr(3), build one out of rindex(3).
     98 .if empty(SRCS:Mstrrchr.S)
     99 OBJS+=	strrchr.o
    100 strrchr.o: rindex.c
    101 	${COMPILE.c} -DSTRRCHR ${.ALLSRC} -o ${.TARGET}
    102 	@${LD} -x -r ${.TARGET}
    103 	@mv a.out ${.TARGET}
    104 
    105 strrchr.po: rindex.c
    106 	${COMPILE.c} -DSTRRCHR -p ${.ALLSRC} -o ${.TARGET}
    107 	@${LD} -X -r ${.TARGET}
    108 	@mv a.out ${.TARGET}
    109 
    110 strrchr.so: rindex.c
    111 	${COMPILE.c} ${PICFLAG} -DPIC -DSTRRCHR ${.ALLSRC} -o ${.TARGET}
    112 
    113 LOBJS+= strrchr.ln
    114 strrchr.ln: rindex.c
    115 	${LINT} -DSTRRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
    116 	    ${.ALLSRC}
    117 .endif
    118 
    119 MAN+=	bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \
    120 	memcmp.3 memcpy.3 memmove.3 memset.3 rindex.3 strcasecmp.3 strcat.3 \
    121 	strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 \
    122 	string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \
    123 	strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3
    124 
    125 MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3
    126 MLINKS+=strcasecmp.3 strncasecmp.3
    127 MLINKS+=strcat.3 strncat.3
    128 MLINKS+=strcmp.3 strncmp.3
    129 MLINKS+=strcpy.3 strncpy.3
    130