Home | History | Annotate | Line # | Download | only in string
Makefile.inc revision 1.44
      1 #	from: @(#)Makefile.inc	8.1 (Berkeley) 6/4/93
      2 #	$NetBSD: Makefile.inc,v 1.44 1998/01/30 23:45:23 perry Exp $
      3 
      4 # string sources
      5 .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/string ${.CURDIR}/string
      6 
      7 # XXX Warning: the merge of this makefile to deal with the new
      8 # memset/bzero stuff isn't finished yet. In particular, bzero is still
      9 # being built on its own but *should* be built from memset.c
     10 
     11 SRCS+=	bm.c strcasecmp.c strcoll.c strdup.c strerror.c \
     12 	strmode.c strsignal.c strtok.c strtok_r.c strxfrm.c \
     13 	__strerror.c __strsignal.c
     14 
     15 # machine-dependent net sources
     16 # m-d Makefile.inc must include sources for:
     17 #	bcmp() bcopy() bzero() ffs() index() memchr() memcmp() memset()
     18 #	rindex() strcat() strcmp() strcpy() strcspn() strlen()
     19 #	strncat() strncmp() strncpy() strpbrk() strsep()
     20 #	strspn() strstr() swav()
     21 # m-d Makefile.inc may include sources for:
     22 #	memcpy() memmove() strchr() strrchr()
     23 
     24 .include "${.CURDIR}/arch/${MACHINE_ARCH}/string/Makefile.inc"
     25 
     26 # if no machine specific memccpy(3), use the machine independent version.
     27 .if empty(SRCS:Mmemccpy.S)
     28 SRCS+=	memccpy.c
     29 .endif
     30 
     31 # if no machine specific memmove(3), build one out of bcopy(3).
     32 .if empty(SRCS:Mmemmove.S)
     33 OBJS+=	memmove.o
     34 memmove.o: bcopy.c
     35 	@echo ${COMPILE.c:Q} -DMEMMOVE ${.ALLSRC} -o ${.TARGET}
     36 	@${COMPILE.c} -DMEMMOVE ${.ALLSRC} -o ${.TARGET}.o
     37 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
     38 	@rm -f ${.TARGET}.o
     39 
     40 memmove.po: bcopy.c
     41 	@echo ${COMPILE.c:Q} -DMEMMOVE -pg ${.ALLSRC} -o ${.TARGET}
     42 	@${COMPILE.c} -DMEMMOVE -pg ${.ALLSRC} -o ${.TARGET}.o
     43 	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
     44 	@rm -f ${.TARGET}.o
     45 
     46 memmove.so: bcopy.c
     47 	@echo ${COMPILE.c:Q} -DMEMMOVE ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}
     48 	@${COMPILE.c} -DMEMMOVE ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o
     49 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
     50 	@rm -f ${.TARGET}.o
     51 
     52 LOBJS+= memmove.ln
     53 memmove.ln: bcopy.c
     54 	${LINT} -DMEMMOVE ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
     55 	    ${.ALLSRC}
     56 .endif
     57 
     58 # if no machine specific memcpy(3), build one out of bcopy(3).
     59 # if there is a machine specific memmove(3), we'll assume it aliases
     60 # memcpy(3).
     61 .if empty(SRCS:Mmemcpy.S)
     62 .if empty(SRCS:Mmemmove.S)
     63 OBJS+=	memcpy.o
     64 memcpy.o: bcopy.c
     65 	@echo ${COMPILE.c:Q} -DMEMCOPY ${.ALLSRC} -o ${.TARGET}
     66 	@${COMPILE.c} -DMEMCOPY ${.ALLSRC} -o ${.TARGET}.o
     67 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
     68 	@rm -f ${.TARGET}.o
     69 
     70 memcpy.po: bcopy.c
     71 	@echo ${COMPILE.c:Q} -DMEMCOPY -pg ${.ALLSRC} -o ${.TARGET}
     72 	@${COMPILE.c} -DMEMCOPY -pg ${.ALLSRC} -o ${.TARGET}.o
     73 	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
     74 	@rm -f ${.TARGET}.o
     75 
     76 memcpy.so: bcopy.c
     77 	@echo ${COMPILE.c:Q} -DMEMCOPY ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}
     78 	@${COMPILE.c} -DMEMCOPY ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o
     79 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
     80 	@rm -f ${.TARGET}.o
     81 
     82 LOBJS+= memcpy.ln
     83 memcpy.ln: bcopy.c
     84 	${LINT} -DMEMCOPY ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
     85 	    ${.ALLSRC}
     86 .endif
     87 .endif
     88 
     89 # if no machine specific strchr(3), build one out of index(3).
     90 .if empty(SRCS:Mstrchr.S)
     91 OBJS+=	strchr.o
     92 strchr.o: index.c
     93 	@echo ${COMPILE.c:Q} -DSTRCHR ${.ALLSRC} -o ${.TARGET}
     94 	@${COMPILE.c} -DSTRCHR ${.ALLSRC} -o ${.TARGET}.o
     95 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
     96 	@rm -f ${.TARGET}.o
     97 
     98 strchr.po: index.c
     99 	@echo ${COMPILE.c:Q} -DSTRCHR -pg ${.ALLSRC} -o ${.TARGET}
    100 	@${COMPILE.c} -DSTRCHR -pg ${.ALLSRC} -o ${.TARGET}.o
    101 	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
    102 	@rm -f ${.TARGET}.o
    103 
    104 strchr.so: index.c
    105 	@echo ${COMPILE.c:Q} -DSTRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}
    106 	@${COMPILE.c} -DSTRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o
    107 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
    108 	@rm -f ${.TARGET}.o
    109 
    110 LOBJS+= strchr.ln
    111 strchr.ln: index.c
    112 	${LINT} -DSTRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
    113 	    ${.ALLSRC}
    114 .endif
    115 
    116 # if no machine specific strrchr(3), build one out of rindex(3).
    117 .if empty(SRCS:Mstrrchr.S)
    118 OBJS+=	strrchr.o
    119 strrchr.o: rindex.c
    120 	@echo ${COMPILE.c:Q} -DSTRRCHR ${.ALLSRC} -o ${.TARGET}
    121 	@${COMPILE.c} -DSTRRCHR ${.ALLSRC} -o ${.TARGET}.o
    122 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
    123 	@rm -f ${.TARGET}.o
    124 
    125 strrchr.po: rindex.c
    126 	@echo ${COMPILE.c:Q} -DSTRRCHR -pg ${.ALLSRC} -o ${.TARGET}
    127 	@${COMPILE.c} -DSTRRCHR -pg ${.ALLSRC} -o ${.TARGET}.o
    128 	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
    129 	@rm -f ${.TARGET}.o
    130 
    131 strrchr.so: rindex.c
    132 	@echo ${COMPILE.c:Q} -DSTRRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}
    133 	@${COMPILE.c} -DSTRRCHR ${CPICFLAGS} ${.ALLSRC} -o ${.TARGET}.o
    134 	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
    135 	@rm -f ${.TARGET}.o
    136 
    137 LOBJS+= strrchr.ln
    138 strrchr.ln: rindex.c
    139 	${LINT} -DSTRRCHR ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i -o ${.TARGET} \
    140 	    ${.ALLSRC}
    141 .endif
    142 
    143 MAN+=	bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \
    144 	memcmp.3 memcpy.3 memmove.3 memset.3 rindex.3 strcasecmp.3 strcat.3 \
    145 	strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 \
    146 	string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \
    147 	strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3
    148 
    149 MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3
    150 MLINKS+=strcasecmp.3 strncasecmp.3
    151 MLINKS+=strcat.3 strncat.3
    152 MLINKS+=strcmp.3 strncmp.3
    153 MLINKS+=strcpy.3 strncpy.3
    154